Skip to content

Commit 8931964

Browse files
xialongleeclaudesteipete
authored
fix(anthropic): add Fable 5 to Claude CLI catalog (#101453)
* fix(anthropic): add claude-fable-5 to CLI allowlist, aliases, labels, and context window CLI path was missing claude-fable-5 across all four metadata layers while the direct Anthropic provider path in register.runtime.ts already had full support via isAnthropicFable5Model() / resolveAnthropicFixedContextWindow(). - CLAUDE_CLI_DEFAULT_ALLOWLIST_REFS: add claude-cli/claude-fable-5 - CLAUDE_CLI_MODEL_ALIASES: add fable/fable-5/claude-fable-5 mappings - CLAUDE_CLI_CONTEXT_WINDOWS: add claude-fable-5 -> 1_000_000 (was falling back to 200K) - CLAUDE_CLI_MODEL_LABELS: add Claude Fable 5 (Claude CLI) - resolveClaudeCliImageMediaInput: add fable-5 to 2576 max-side tier Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * fix(anthropic): route fable alias through context/model-ref canonicalization paths * fix(agent): include claude-cli in fable-5/mythos-5 fixed context window resolution * fix(anthropic): add claude-fable-5 to static CLI manifest catalog * test(anthropic): cover fable-5 alias canonicalization in bare and provider-qualified forms * style(anthropic): fix indentation in plugin manifest * fix(anthropic): publish Fable CLI output limit --------- Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
1 parent e653401 commit 8931964

9 files changed

Lines changed: 70 additions & 9 deletions

File tree

‎extensions/anthropic/claude-model-refs.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { CLAUDE_CLI_BACKEND_ID, CLAUDE_CLI_MODEL_ALIASES } from "./cli-constants
88
const DEFAULT_CLAUDE_MODEL_BY_FAMILY: Record<string, string> = {
99
opus: "claude-opus-4-8",
1010
sonnet: "claude-sonnet-5",
11+
fable: "claude-fable-5",
1112
haiku: "claude-haiku-4-5",
1213
};
1314

‎extensions/anthropic/cli-catalog.ts‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@ import { CLAUDE_CLI_BACKEND_ID, CLAUDE_CLI_DEFAULT_ALLOWLIST_REFS } from "./cli-
99
const CLAUDE_CLI_DEFAULT_CONTEXT_WINDOW = 200_000;
1010
const CLAUDE_CLI_CONTEXT_WINDOWS: Record<string, number> = {
1111
"claude-sonnet-5": 1_000_000,
12+
"claude-fable-5": 1_000_000,
1213
};
1314
const CLAUDE_CLI_DEFAULT_MAX_OUTPUT_TOKENS = 64_000;
1415
const CLAUDE_CLI_MAX_OUTPUT_TOKENS: Record<string, number> = {
1516
"claude-opus-4-8": 128_000,
1617
"claude-opus-4-7": 128_000,
1718
"claude-opus-4-6": 128_000,
1819
"claude-sonnet-5": 128_000,
20+
"claude-fable-5": 128_000,
1921
"claude-sonnet-4-6": 128_000,
2022
};
2123

@@ -24,12 +26,18 @@ const CLAUDE_CLI_MODEL_LABELS: Record<string, string> = {
2426
"claude-opus-4-7": "Claude Opus 4.7 (Claude CLI)",
2527
"claude-opus-4-6": "Claude Opus 4.6 (Claude CLI)",
2628
"claude-sonnet-5": "Claude Sonnet 5 (Claude CLI)",
29+
"claude-fable-5": "Claude Fable 5 (Claude CLI)",
2730
"claude-sonnet-4-6": "Claude Sonnet 4.6 (Claude CLI)",
2831
};
2932

3033
function resolveClaudeCliImageMediaInput(id: string): ModelCatalogEntry["mediaInput"] {
3134
const maxSidePx =
32-
id === "claude-opus-4-8" || id === "claude-opus-4-7" || id === "claude-sonnet-5" ? 2576 : 1568;
35+
id === "claude-opus-4-8" ||
36+
id === "claude-opus-4-7" ||
37+
id === "claude-sonnet-5" ||
38+
id === "claude-fable-5"
39+
? 2576
40+
: 1568;
3341
return {
3442
image: {
3543
maxSidePx,

‎extensions/anthropic/cli-constants.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export const CLAUDE_CLI_CANONICAL_DEFAULT_MODEL_REF = `anthropic/${CLAUDE_CLI_CA
2020
export const CLAUDE_CLI_DEFAULT_ALLOWLIST_REFS = [
2121
CLAUDE_CLI_DEFAULT_MODEL_REF,
2222
`${CLAUDE_CLI_BACKEND_ID}/claude-sonnet-5`,
23+
`${CLAUDE_CLI_BACKEND_ID}/claude-fable-5`,
2324
`${CLAUDE_CLI_BACKEND_ID}/claude-opus-4-7`,
2425
`${CLAUDE_CLI_BACKEND_ID}/claude-sonnet-4-6`,
2526
`${CLAUDE_CLI_BACKEND_ID}/claude-opus-4-6`,
@@ -39,6 +40,9 @@ export const CLAUDE_CLI_MODEL_ALIASES: Record<string, string> = {
3940
"claude-sonnet-5": "claude-sonnet-5",
4041
"sonnet-4.6": "claude-sonnet-4-6",
4142
"claude-sonnet-4-6": "claude-sonnet-4-6",
43+
fable: "fable",
44+
"fable-5": "claude-fable-5",
45+
"claude-fable-5": "claude-fable-5",
4246
haiku: "haiku",
4347
};
4448

‎extensions/anthropic/cli-migration.test.ts‎

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,20 @@ describe("anthropic Claude model refs", () => {
6161
);
6262
});
6363

64+
it("canonicalizes fable family aliases in bare and provider-qualified forms", () => {
65+
// "fable-5" must map to the full model id, not the family name: the
66+
// canonicalizer only accepts alias values that already start with
67+
// "claude-", so a family-name value would leave the shorthand unresolved.
68+
expect(resolveKnownAnthropicModelRef("fable")).toBe("anthropic/claude-fable-5");
69+
expect(resolveKnownAnthropicModelRef("fable-5")).toBe("anthropic/claude-fable-5");
70+
expect(resolveKnownAnthropicModelRef("claude-fable-5")).toBe("anthropic/claude-fable-5");
71+
expect(resolveKnownAnthropicModelRef("claude-cli/fable")).toBe("anthropic/claude-fable-5");
72+
expect(resolveKnownAnthropicModelRef("claude-cli/fable-5")).toBe("anthropic/claude-fable-5");
73+
expect(resolveKnownAnthropicModelRef("claude-cli/claude-fable-5")).toBe(
74+
"anthropic/claude-fable-5",
75+
);
76+
});
77+
6478
it("preserves the current claude-haiku-4-5 model and its bare alias", () => {
6579
// claude-haiku-4-5 is a current production model (not retired), so neither
6680
// its full ref, its dotted variant, nor the bare "haiku" family alias must
@@ -166,14 +180,15 @@ describe("anthropic cli migration", () => {
166180
alias: "Opus",
167181
agentRuntime: { id: "claude-cli" },
168182
},
169-
"anthropic/claude-opus-4-8": { agentRuntime: { id: "claude-cli" } },
170-
"anthropic/claude-sonnet-5": { agentRuntime: { id: "claude-cli" } },
171-
"anthropic/claude-sonnet-4-6": { agentRuntime: { id: "claude-cli" } },
172183
"anthropic/claude-opus-4-6": {
173184
alias: "Opus",
174185
agentRuntime: { id: "claude-cli" },
175186
},
176187
"openai/gpt-5.2": {},
188+
"anthropic/claude-opus-4-8": { agentRuntime: { id: "claude-cli" } },
189+
"anthropic/claude-sonnet-5": { agentRuntime: { id: "claude-cli" } },
190+
"anthropic/claude-fable-5": { agentRuntime: { id: "claude-cli" } },
191+
"anthropic/claude-sonnet-4-6": { agentRuntime: { id: "claude-cli" } },
177192
},
178193
},
179194
},
@@ -259,9 +274,10 @@ describe("anthropic cli migration", () => {
259274
defaults: {
260275
models: {
261276
"openai/gpt-5.2": {},
277+
"anthropic/claude-opus-4-7": { agentRuntime: { id: "claude-cli" } },
262278
"anthropic/claude-opus-4-8": { agentRuntime: { id: "claude-cli" } },
263279
"anthropic/claude-sonnet-5": { agentRuntime: { id: "claude-cli" } },
264-
"anthropic/claude-opus-4-7": { agentRuntime: { id: "claude-cli" } },
280+
"anthropic/claude-fable-5": { agentRuntime: { id: "claude-cli" } },
265281
"anthropic/claude-sonnet-4-6": { agentRuntime: { id: "claude-cli" } },
266282
"anthropic/claude-opus-4-6": { agentRuntime: { id: "claude-cli" } },
267283
},
@@ -304,9 +320,10 @@ describe("anthropic cli migration", () => {
304320
defaults: {
305321
model: { primary: "anthropic/claude-opus-4-7" },
306322
models: {
323+
"anthropic/claude-opus-4-7": { agentRuntime: { id: "claude-cli" } },
307324
"anthropic/claude-opus-4-8": { agentRuntime: { id: "claude-cli" } },
308325
"anthropic/claude-sonnet-5": { agentRuntime: { id: "claude-cli" } },
309-
"anthropic/claude-opus-4-7": { agentRuntime: { id: "claude-cli" } },
326+
"anthropic/claude-fable-5": { agentRuntime: { id: "claude-cli" } },
310327
"anthropic/claude-sonnet-4-6": { agentRuntime: { id: "claude-cli" } },
311328
"anthropic/claude-opus-4-6": { agentRuntime: { id: "claude-cli" } },
312329
},

‎extensions/anthropic/index.test.ts‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,20 @@ describe("anthropic provider replay hooks", () => {
134134
});
135135
});
136136

137+
it("publishes Claude Fable 5 CLI metadata without downgrading its API contract", () => {
138+
expect(
139+
buildClaudeCliCatalogEntries().find((model) => model.id === "claude-fable-5"),
140+
).toMatchObject({
141+
id: "claude-fable-5",
142+
name: "Claude Fable 5 (Claude CLI)",
143+
contextWindow: 1_000_000,
144+
maxTokens: 128_000,
145+
mediaInput: {
146+
image: { maxSidePx: 2576, preferredSidePx: 2576, tokenMode: "provider" },
147+
},
148+
});
149+
});
150+
137151
it("keeps bare Claude CLI context plan-safe while publishing output limits", () => {
138152
const models = buildClaudeCliCatalogEntries();
139153
for (const id of [

‎extensions/anthropic/openclaw.plugin.json‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"providerCatalogEntry": "./provider-discovery.ts",
1515
"modelCatalog": {
1616
"runtimeAugment": true,
17-
"providers": {
17+
"providers": {
1818
"claude-cli": {
1919
"models": [
2020
{
@@ -28,6 +28,17 @@
2828
"contextWindow": 1000000,
2929
"maxTokens": 128000
3030
},
31+
{
32+
"id": "claude-fable-5",
33+
"name": "Claude Fable 5 (Claude CLI)",
34+
"reasoning": true,
35+
"input": ["text", "image"],
36+
"mediaInput": {
37+
"image": { "maxSidePx": 2576, "preferredSidePx": 2576, "tokenMode": "provider" }
38+
},
39+
"contextWindow": 1000000,
40+
"maxTokens": 128000
41+
},
3142
{
3243
"id": "claude-opus-4-8",
3344
"name": "Claude Opus 4.8 (Claude CLI)",

‎src/agents/cli-runner/prepare-claude.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ export const CLAUDE_CLI_CONTEXT_MODEL_ALIASES: Record<string, string> = {
1010
"sonnet-5": "claude-sonnet-5",
1111
"sonnet-4.6": "claude-sonnet-4-6",
1212
"sonnet-4-6": "claude-sonnet-4-6",
13+
fable: "claude-fable-5",
14+
"fable-5": "claude-fable-5",
1315
};
1416

1517
export function resolveNodeClaudePlacement(params: {

‎src/agents/context-resolution.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,13 +197,13 @@ export function resolveAnthropicFixedContextWindow(
197197
return undefined;
198198
}
199199
if (
200-
(provider === "anthropic" || provider === "anthropic-vertex") &&
200+
(provider === "anthropic" || provider === "anthropic-vertex" || provider === "claude-cli") &&
201201
/^claude-fable-5(?=$|[^a-z0-9])/.test(modelId)
202202
) {
203203
return ANTHROPIC_FABLE_CONTEXT_TOKENS;
204204
}
205205
if (
206-
(provider === "anthropic" || provider === "anthropic-vertex") &&
206+
(provider === "anthropic" || provider === "anthropic-vertex" || provider === "claude-cli") &&
207207
/^claude-mythos-5(?=$|[^a-z0-9])/.test(modelId)
208208
) {
209209
return ANTHROPIC_MYTHOS_5_CONTEXT_TOKENS;

‎src/agents/context.test.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,8 +558,10 @@ describe("resolveContextTokensForModel", () => {
558558
it.each([
559559
["anthropic", "claude-fable-5", ANTHROPIC_FABLE_CONTEXT_TOKENS],
560560
["anthropic-vertex", "claude-fable-5", ANTHROPIC_FABLE_CONTEXT_TOKENS],
561+
["claude-cli", "claude-fable-5", ANTHROPIC_FABLE_CONTEXT_TOKENS],
561562
["anthropic", "claude-mythos-5", ANTHROPIC_MYTHOS_5_CONTEXT_TOKENS],
562563
["anthropic-vertex", "claude-mythos-5", ANTHROPIC_MYTHOS_5_CONTEXT_TOKENS],
564+
["claude-cli", "claude-mythos-5", ANTHROPIC_MYTHOS_5_CONTEXT_TOKENS],
563565
["anthropic", "claude-sonnet-5", ANTHROPIC_SONNET_5_CONTEXT_TOKENS],
564566
["anthropic-vertex", "claude-sonnet-5", ANTHROPIC_SONNET_5_CONTEXT_TOKENS],
565567
["claude-cli", "claude-sonnet-5", ANTHROPIC_SONNET_5_CONTEXT_TOKENS],
@@ -697,8 +699,10 @@ describe("resolveContextTokensForModel", () => {
697699
it.each([
698700
["anthropic", "claude-fable-5", ANTHROPIC_FABLE_CONTEXT_TOKENS],
699701
["anthropic-vertex", "claude-fable-5", ANTHROPIC_FABLE_CONTEXT_TOKENS],
702+
["claude-cli", "claude-fable-5", ANTHROPIC_FABLE_CONTEXT_TOKENS],
700703
["anthropic", "claude-mythos-5", ANTHROPIC_MYTHOS_5_CONTEXT_TOKENS],
701704
["anthropic-vertex", "claude-mythos-5", ANTHROPIC_MYTHOS_5_CONTEXT_TOKENS],
705+
["claude-cli", "claude-mythos-5", ANTHROPIC_MYTHOS_5_CONTEXT_TOKENS],
702706
["anthropic", "claude-sonnet-5", ANTHROPIC_SONNET_5_CONTEXT_TOKENS],
703707
["anthropic-vertex", "claude-sonnet-5", ANTHROPIC_SONNET_5_CONTEXT_TOKENS],
704708
["claude-cli", "claude-sonnet-5", ANTHROPIC_SONNET_5_CONTEXT_TOKENS],

0 commit comments

Comments
 (0)