diff --git a/apps/daemon/src/runtimes/defs/claude.ts b/apps/daemon/src/runtimes/defs/claude.ts index d5fc28d5478..b48f259bf60 100644 --- a/apps/daemon/src/runtimes/defs/claude.ts +++ b/apps/daemon/src/runtimes/defs/claude.ts @@ -8,6 +8,17 @@ const CLAUDE_FALLBACK_MODELS = [ { id: 'sonnet', label: 'Sonnet (alias)' }, { id: 'opus', label: 'Opus (alias)' }, { id: 'haiku', label: 'Haiku (alias)' }, + // Current generation. Kept in sync with the model support matrix + // clampClaudeReasoning (shared.ts) already encodes -- if a model shows up + // there, it should be selectable here too. + { id: 'claude-fable-5', label: 'claude-fable-5' }, + { id: 'claude-opus-4-8', label: 'claude-opus-4-8' }, + { id: 'claude-sonnet-5', label: 'claude-sonnet-5' }, + { id: 'claude-haiku-4-5-20251001', label: 'claude-haiku-4-5-20251001' }, + { id: 'claude-opus-4-7', label: 'claude-opus-4-7' }, + { id: 'claude-sonnet-4-6', label: 'claude-sonnet-4-6' }, + { id: 'claude-opus-4-6', label: 'claude-opus-4-6' }, + // Prior generation, kept for anyone still pinned to it. { id: 'claude-opus-4-5', label: 'claude-opus-4-5' }, { id: 'claude-sonnet-4-5', label: 'claude-sonnet-4-5' }, { id: 'claude-haiku-4-5', label: 'claude-haiku-4-5' }, diff --git a/apps/daemon/tests/runtimes/agent-args.test.ts b/apps/daemon/tests/runtimes/agent-args.test.ts index 7ea22fe079b..15bf0958b35 100644 --- a/apps/daemon/tests/runtimes/agent-args.test.ts +++ b/apps/daemon/tests/runtimes/agent-args.test.ts @@ -1007,6 +1007,17 @@ test('claude helpArgs probes the -p subcommand where --add-dir lives (issue #430 ); }); +test('claude fallback models include the current generation, not just 4.5', () => { + const ids = claude.fallbackModels.map((m) => m.id); + assert.ok(ids.includes('claude-fable-5'), 'Fable 5 must be selectable'); + assert.ok(ids.includes('claude-opus-4-8')); + assert.ok(ids.includes('claude-sonnet-5')); + assert.ok(ids.includes('claude-haiku-4-5-20251001')); + assert.ok(ids.includes('claude-opus-4-7')); + assert.ok(ids.includes('claude-sonnet-4-6')); + assert.ok(ids.includes('claude-opus-4-6')); +}); + // server.ts:4615 branches on `def.promptInputFormat` to decide how to write // the composed prompt to a stdin-fed child: 'stream-json' writes one JSONL // `user` message and keeps stdin open, anything else writes the raw prompt