fix(claude): default unset models to Opus 5 (#13055)

Resolve unset Claude models to Opus 5 across CLI and ACP execution, preserve explicit and provider-specific overrides, and show the default in agent configuration.

Verified 212 focused tests after merging master, UI typecheck and token gates, and all CI checks. Greptile reviewed the final head at 5/5.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip authored and GitHub committed 2026-09-08 15:13:27 -05:00
1 parent ebaeba40ee
commit 5128b4f323
11 files changed
+155 -10

No files matched your search

@@ -350,6 +350,34 @@ function createLocalSandboxRunner() {
}
describe("claude execute", () => {
it.each([
[undefined, "claude-opus-5"],
["", "claude-opus-5"],
[" ", "claude-opus-5"],
["claude-sonnet-4-5", "claude-sonnet-4-5"],
])("passes the resolved model to the CLI for %j", async (model, expected) => {
const root = await fs.mkdtemp(path.join(os.tmpdir(), "paperclip-claude-default-"));
const { workspace, commandPath, capturePath, restore } = await setupExecuteEnv(root);
try {
const result = await execute({
runId: "run-default",
agent: { id: "agent-1", companyId: "co-1", name: "Test", adapterType: "claude_local", adapterConfig: {} },
runtime: { sessionId: null, sessionParams: null, sessionDisplayId: null, taskKey: null },
config: {
engine: "cli", model, command: commandPath, cwd: workspace,
env: { PAPERCLIP_TEST_CAPTURE_PATH: capturePath },
},
context: {}, onLog: async () => {},
});
expect(result.exitCode).toBe(0);
const { argv } = JSON.parse(await fs.readFile(capturePath, "utf8"));
expect(argv[argv.indexOf("--model") + 1]).toBe(expected);
} finally {
restore();
await fs.rm(root, { recursive: true, force: true });
}
});
it("uses a strict per-agent MCP config only when managed servers are present", async () => {
const root = await fs.mkdtemp(path.join(os.tmpdir(), "paperclip-claude-mcp-config-"));
const { workspace, commandPath, capturePath, restore } = await setupExecuteEnv(root);