feat: add Fable model presets for Claude sessions (#860)

* feat: add Fable model presets for Claude sessions

Claude Code 2.x accepts the fable / fable[1m] model aliases for
Fable 5. hapi passes the model string through verbatim, so adding
the presets to CLAUDE_MODEL_LABELS surfaces them in the new-session
and composer model pickers, labels, and the 1M context-window
heuristic.

* test: update modelOptions full-list assertions for Fable presets

Addresses review feedback on #860: getModelOptionsForFlavor appends
every Claude preset, so the two complete-array expectations must
include the new fable entries.
This commit is contained in:
hanger
2026-06-10 13:56:30 +08:00
committed by GitHub
parent 1f92a31b12
commit e2625b8b47
4 changed files with 15 additions and 4 deletions
+3 -1
View File
@@ -2,7 +2,9 @@ export const CLAUDE_MODEL_LABELS = {
sonnet: 'Sonnet',
'sonnet[1m]': 'Sonnet 1M',
opus: 'Opus',
'opus[1m]': 'Opus 1M'
'opus[1m]': 'Opus 1M',
fable: 'Fable',
'fable[1m]': 'Fable 1M'
} as const
export type ClaudeModelPreset = keyof typeof CLAUDE_MODEL_LABELS
@@ -10,6 +10,8 @@ describe('getClaudeComposerModelOptions', () => {
{ value: 'sonnet[1m]', label: 'Sonnet 1M' },
{ value: 'opus', label: 'Opus' },
{ value: 'opus[1m]', label: 'Opus 1M' },
{ value: 'fable', label: 'Fable' },
{ value: 'fable[1m]', label: 'Fable 1M' },
])
})
@@ -20,6 +22,8 @@ describe('getClaudeComposerModelOptions', () => {
{ value: 'sonnet[1m]', label: 'Sonnet 1M' },
{ value: 'opus', label: 'Opus' },
{ value: 'opus[1m]', label: 'Opus 1M' },
{ value: 'fable', label: 'Fable' },
{ value: 'fable[1m]', label: 'Fable 1M' },
])
})
})
@@ -27,7 +27,9 @@ describe('getModelOptionsForFlavor', () => {
{ value: 'sonnet', label: 'Sonnet' },
{ value: 'sonnet[1m]', label: 'Sonnet 1M' },
{ value: 'opus', label: 'Opus' },
{ value: 'opus[1m]', label: 'Opus 1M' }
{ value: 'opus[1m]', label: 'Opus 1M' },
{ value: 'fable', label: 'Fable' },
{ value: 'fable[1m]', label: 'Fable 1M' }
])
})
@@ -41,7 +43,9 @@ describe('getModelOptionsForFlavor', () => {
{ value: 'sonnet', label: 'Sonnet' },
{ value: 'sonnet[1m]', label: 'Sonnet 1M' },
{ value: 'opus', label: 'Opus' },
{ value: 'opus[1m]', label: 'Opus 1M' }
{ value: 'opus[1m]', label: 'Opus 1M' },
{ value: 'fable', label: 'Fable' },
{ value: 'fable[1m]', label: 'Fable 1M' }
])
})
+2 -1
View File
@@ -14,9 +14,10 @@ describe('Claude model options', () => {
})
it('exposes friendly labels for Claude model presets', () => {
expect(CLAUDE_MODEL_PRESETS).toEqual(['sonnet', 'sonnet[1m]', 'opus', 'opus[1m]'])
expect(CLAUDE_MODEL_PRESETS).toEqual(['sonnet', 'sonnet[1m]', 'opus', 'opus[1m]', 'fable', 'fable[1m]'])
expect(getClaudeModelLabel('sonnet[1m]')).toBe('Sonnet 1M')
expect(getClaudeModelLabel('opus[1m]')).toBe('Opus 1M')
expect(getClaudeModelLabel('fable[1m]')).toBe('Fable 1M')
})
})