Skip to content

Models: Claude Fable 5.2 (pricing, picker fallback, fable alias) + claude-agent-sdk 0.2.180 - #666

Merged
alex-clickhouse merged 2 commits into
mainfrom
pufit/fable-5-2
Nov 10, 2026
Merged

alex-clickhouse merged 2 commits into
mainfrom
pufit/fable-5-2

Conversation

@pufit

@pufit pufit commented Nov 9, 2026

Copy link
Copy Markdown
Member

Anthropic released Claude Fable 5.2 today — claude-fable-5-2: $8 / $40 per MTok, cache write $10 (5m) / $16 (1h), cache read $0.20, 1M context, 128K output, default effort high, all five effort levels (https://platform.claude.com/docs/en/models/fable-5-2/overview, https://platform.claude.com/docs/en/about-claude/pricing). The composer picker already picks it up through Models-API discovery (6 h cache); what Nerve gets wrong without this change is everything keyed on the model id.

Pricing. MODEL_PRICING matched claude-fable-5-2 by the fable-5 substring, i.e. Fable 5.1's $10/$50 — and that row also charges cache reads at $1.00, which is the original Fable 5 rate; Fable 5.1 reads at $0.25 (0.025x, per the pricing page footnote). New rows fable-5-2 ($8/$40, read $0.20, write $10/$16) and fable-5-1 ($10/$50, read $0.25, write $12.50/$20) sit ahead of the bare fable-5 key, with precedence tests.

Built-in picker fallback. DEFAULT_FALLBACK_MODEL → claude-fable-5-2 (the list used when discovery is off or unavailable).

fable alias. _build_env now defaults ANTHROPIC_DEFAULT_FABLE_MODEL to DEFAULT_FALLBACK_MODEL, the way opus and haiku already track DEFAULT_MODEL / DEFAULT_FAST_MODEL: an Agent/Workflow call or a skill asking for fable gets Nerve's current Fable whatever the CLI's own default is. agent.model_aliases: {fable: …} overrides it, "" unsets it, Bedrock gets no default — the same rules as the other two. (A deliberate choice; drop that hunk if you'd rather leave fable to the CLI.)

claude-agent-sdk 0.2.176 → 0.2.180 (bundled Claude Code CLI 2.1.316 → 2.1.321, whose changelog entry adds Fable 5.2 as the default fable model). Measured with a one-word -p run on claude-fable-5-2 from both bundles: 2.1.316 answers but logs [claude-code:unrecognized_model], reports contextWindow: 200000 and prices the turn at Opus 5.5 rates ($4/$20 + $5 cache write → $0.019633 for 2 in / 4 out / 3,909 cache-write tokens); 2.1.321 reports contextWindow: 1000000 and the Fable 5.2 rates ($0.052036 for 2 / 4 / 5,186). sdk_delta is Nerve's primary cost source and the CLI's window drives its auto-compaction, so Fable 5.2 on the old CLI is booked at half price and compacted at a fifth of its context. The pyproject floor moves to 0.2.180 for the reason the earlier floors moved: the bundled CLI is what every session runs. The lock diff is the one package; 0.2.177–0.2.180 change no Python API (release notes: an optional on_failure hook option, CLI bumps). uv.lock was written with uv 0.12.0 — the version CI pins — which records revision = 3; the revision = 5 on main came from dependabot's newer uv. uv lock --check passes under 0.12.0.

The effort ladder (_MODEL_EFFORT_LEVELS) already covers 5.2 through the fable-5 key — all five levels, confirmed in the migration guide — so only test cases were added there. config.example.yaml, docs/config.md and the GET /api/setup/models example in docs/api.md follow.

Tests run (changed files + every test module importing claude_agent_sdk, on the bumped SDK): test_default_models test_setup_api test_usage_cache_ttl test_engine test_cache_policy test_config_resolution test_models_route test_claude_transport test_agent_extras test_autonomous_turns test_interactive test_tools_schemas test_system_prompt_transport test_static_system_prompt test_inference_principal test_session_context test_schedule_attribution test_external_mode_mcp test_observability_langfuse test_ask_form — 1061 passed. No web changes.

Rollout: a gateway restart after this merge needs uv sync first (new pin).

Generated by Nerve

pufit added 2 commits November 9, 2026 17:30
claude-fable-5-2 ($8/$40 per MTok, cache write $10/$16, cache read $0.20)
was priced by the bare "fable-5" row, i.e. Fable 5.1's $10/$50 — a row
whose $1.00 cache read is Fable 5's rate, not 5.1's $0.25. Give 5.2 and
5.1 their own rows ahead of it, make 5.2 the built-in picker's second
entry, and default the CLI's "fable" alias to that constant the way
"opus" and "haiku" already track theirs. Examples and docs follow.
The 2.1.316 bundle in 0.2.176 takes claude-fable-5-2 as an unrecognized
model: a 200K context window and Opus 5.5 prices, which is what Nerve
books as the turn's cost. 2.1.321 knows the model. Floor raised to match.
@nerveai

nerveai commented Nov 9, 2026

Copy link
Copy Markdown

Nerve PR review · ✅ Ready to merge (once the backend CI job is green)

This PR teaches Nerve about Claude Fable 5.2 everywhere it looks up a model id. The SDK bump matters most. On CLI 2.1.316, a Fable 5.2 turn is charged at Opus 5.5 rates through sdk_delta, the Claude backend's primary cost source, and is compacted at a 200K window. The new fable-5-2 and fable-5-1 rows match Anthropic's published prices. That includes the 0.025x cache-read rate on 5.1, which the old shared fable-5 row charged at 4x. The specific rows are checked before the bare fable-5 key, and model ids carry no date suffix, so no snapshot id lands on the wrong row. The new fable alias default works like the opus and haiku ones: config overrides it, "" unsets it, and Bedrock is skipped. It changes nothing today, because CLI 2.1.321 already defaults fable to 5.2.

Completeness: the precedence and alias tests would fail without the fix. config.example.yaml, docs/config.md and docs/api.md are updated. The lock diff touches only this package, and there is no migration.

Checked: 8 touched and related test modules in an offline sandbox at f8afbca: 561 passed, run on main's SDK 0.2.176, so the new SDK is exercised only by CI "Backend tests", which was still running. Also checked: the SDK v0.2.176→v0.2.180 source diff (only HookMatcher.on_failure changed; Nerve's SubprocessCLITransport and message_parser seams are untouched), the artifact hashes, and the rates against platform.claude.com pricing · automated review by nerveai — mention @nerveai to ask a follow-up.

@pufit
pufit requested a review from alex-clickhouse November 9, 2026 22:43
@alex-clickhouse
alex-clickhouse merged commit d98bac2 into main Nov 10, 2026
4 checks passed
@alex-clickhouse
alex-clickhouse deleted the pufit/fable-5-2 branch November 10, 2026 05:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants