feat(cli): replace ANTHROPIC_SMALL_FAST_MODEL with Fable default (#8343)

Claude Code retired ANTHROPIC_SMALL_FAST_MODEL; expose
ANTHROPIC_DEFAULT_FABLE_MODEL from the claude registry instead.
This commit is contained in:
Adrian Rogala
2026-07-25 07:50:53 +02:00
committed by GitHub
parent 53a91b3df8
commit 9a0e764459
3 changed files with 14 additions and 7 deletions

View File

@@ -258,11 +258,12 @@ export function getProviderCategory(provider: string): "oauth" | "apikey" {
}
/**
* Derive the latest opus/sonnet/haiku model IDs from the `claude` registry entry.
* Derive the latest fable/opus/sonnet/haiku model IDs from the `claude` registry entry.
* Picks the first model whose ID matches each family pattern — registry order
* determines precedence, so newer models should be listed first.
*/
export function getClaudeCodeDefaultModels(): {
fable: string;
opus: string;
sonnet: string;
haiku: string;
@@ -270,6 +271,7 @@ export function getClaudeCodeDefaultModels(): {
const models = REGISTRY.claude?.models ?? [];
const find = (pattern: RegExp) => models.find((m) => pattern.test(m.id))?.id ?? "";
return {
fable: find(/fable/i),
opus: find(/opus/i),
sonnet: find(/sonnet/i),
haiku: find(/haiku/i),

View File

@@ -23,11 +23,12 @@ export const CLI_TOOLS: Record<string, CliCatalogEntry> = {
envVars: {
baseUrl: "ANTHROPIC_BASE_URL",
model: "ANTHROPIC_MODEL",
fableModel: "ANTHROPIC_DEFAULT_FABLE_MODEL",
opusModel: "ANTHROPIC_DEFAULT_OPUS_MODEL",
sonnetModel: "ANTHROPIC_DEFAULT_SONNET_MODEL",
haikuModel: "ANTHROPIC_DEFAULT_HAIKU_MODEL",
},
modelAliases: ["default", "sonnet", "opus", "haiku", "opusplan"],
modelAliases: ["default", "fable", "sonnet", "opus", "haiku", "opusplan"],
settingsFile: "~/.claude/settings.json",
defaultCommand: "claude",
defaultModels: [
@@ -40,11 +41,11 @@ export const CLI_TOOLS: Record<string, CliCatalogEntry> = {
isTopLevel: true,
},
{
id: "smallFast",
name: "Small Fast Model",
alias: "smallFast",
envKey: "ANTHROPIC_SMALL_FAST_MODEL",
defaultValue: _cc.haiku ? `cc/${_cc.haiku}` : "cc/claude-haiku-4-5-20251001",
id: "fable",
name: "Claude Fable",
alias: "fable",
envKey: "ANTHROPIC_DEFAULT_FABLE_MODEL",
defaultValue: _cc.fable ? `cc/${_cc.fable}` : "cc/claude-fable-5",
isTopLevel: true,
},
{

View File

@@ -6,11 +6,15 @@ test("getClaudeCodeDefaultModels returns expected default models", () => {
const models = getClaudeCodeDefaultModels();
// They should be non-empty strings because providerRegistry is populated statically
assert.ok(typeof models.fable === "string");
assert.ok(typeof models.opus === "string");
assert.ok(typeof models.sonnet === "string");
assert.ok(typeof models.haiku === "string");
// Check that the returned IDs match the expected patterns
if (models.fable) {
assert.match(models.fable, /fable/i);
}
if (models.opus) {
assert.match(models.opus, /opus/i);
}