mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-04 19:28:46 +01:00
fix(claude): use discovered runner in guided agent setup
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
f1ef0a9c9b
commit
e2e5c60496
2 files changed
+17
No files matched your search
@@ -368,6 +368,7 @@ function Setup({
|
||||
...defaultCreateValues,
|
||||
adapterType,
|
||||
runner,
|
||||
resolvedRunner: runner === "auto" ? defaultRunner : runner,
|
||||
model:
|
||||
model || (brandType === "codex_local" ? DEFAULT_CODEX_LOCAL_MODEL : ""),
|
||||
thinkingEffort: effort,
|
||||
|
||||
@@ -200,6 +200,22 @@ afterEach(async () => {
|
||||
container.remove();
|
||||
});
|
||||
describe("New agent setup", () => {
|
||||
it.each(["paperclip", "legacy", undefined] as const)("uses Claude's discovered %s default for Auto setup and hire", async (defaultRunner) => {
|
||||
settings.getExperimental.mockResolvedValue({ enableNativeRunner: false });
|
||||
state.adapters = (state.adapters as any[]).map(adapter => adapter.type === "claude_local"
|
||||
? { ...adapter, supportedRunners: ["paperclip", "legacy"], defaultRunner } : adapter);
|
||||
await render("claude_local");
|
||||
await connect("Claude");
|
||||
await click("Finish setup");
|
||||
expect(api.hire).toHaveBeenCalledTimes(1);
|
||||
for (const config of [api.testEnvironment.mock.calls[0][2].adapterConfig, api.hire.mock.calls[0][1].adapterConfig]) {
|
||||
if (defaultRunner === "paperclip") expect(config).not.toHaveProperty("maxTurnsPerRun");
|
||||
else expect(config.maxTurnsPerRun).toBe(1000);
|
||||
expect(config).not.toHaveProperty("resolvedRunner");
|
||||
}
|
||||
expect(api.hire.mock.calls[0][1]).not.toHaveProperty("runner");
|
||||
});
|
||||
|
||||
it("records an explicit legacy choice when it matches the Windows default, then preserves it on Linux", async () => {
|
||||
settings.get.mockResolvedValue({ defaultEnvironmentId: "local-1" });
|
||||
envApi.list.mockResolvedValue([
|
||||
|
||||
Reference in new issue
Block a user