Repository navigation
Models: Claude Fable 5.2 (pricing, picker fallback, fable alias) + claude-agent-sdk 0.2.180 - #666
Conversation
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.
|
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 Completeness: the precedence and alias tests would fail without the fix. Checked: 8 touched and related test modules in an offline sandbox at |
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 efforthigh, 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_PRICINGmatchedclaude-fable-5-2by thefable-5substring, 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 rowsfable-5-2($8/$40, read $0.20, write $10/$16) andfable-5-1($10/$50, read $0.25, write $12.50/$20) sit ahead of the barefable-5key, with precedence tests.Built-in picker fallback.
DEFAULT_FALLBACK_MODEL→claude-fable-5-2(the list used when discovery is off or unavailable).fablealias._build_envnow defaultsANTHROPIC_DEFAULT_FABLE_MODELtoDEFAULT_FALLBACK_MODEL, the wayopusandhaikualready trackDEFAULT_MODEL/DEFAULT_FAST_MODEL: an Agent/Workflow call or a skill asking forfablegets 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 leavefableto 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
fablemodel). Measured with a one-word-prun onclaude-fable-5-2from both bundles: 2.1.316 answers but logs[claude-code:unrecognized_model], reportscontextWindow: 200000and prices the turn at Opus 5.5 rates ($4/$20 + $5 cache write →$0.019633for 2 in / 4 out / 3,909 cache-write tokens); 2.1.321 reportscontextWindow: 1000000and the Fable 5.2 rates ($0.052036for 2 / 4 / 5,186).sdk_deltais 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. Thepyprojectfloor 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 optionalon_failurehook option, CLI bumps).uv.lockwas written with uv 0.12.0 — the version CI pins — which recordsrevision = 3; therevision = 5on main came from dependabot's newer uv.uv lock --checkpasses under 0.12.0.The effort ladder (
_MODEL_EFFORT_LEVELS) already covers 5.2 through thefable-5key — all five levels, confirmed in the migration guide — so only test cases were added there.config.example.yaml,docs/config.mdand theGET /api/setup/modelsexample indocs/api.mdfollow.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 syncfirst (new pin).