Repository navigation
Description
Summary
Wire the new Claude models — Fable 5 (claude-fable-5, new tier above Opus) and Opus 4.8 (claude-opus-4-8) — into the dev-lead and pr-review engines via scripts/engine.sh, with capability-aware, cost-conscious model selection and per-tier fallback. This is the Claude-engine counterpart to #382 (Gemini 3.5) and the implementation of discussion #413.
Why
The Claude engine's highest-capability slots are still pinned to Opus 4.7, with neither Opus 4.8 nor Fable 5 wired in anywhere:
ENGINE_TRIAGE_MODEL = claude-haiku-4-5-20251001
ENGINE_DEEP_MODEL = claude-sonnet-4-6
ENGINE_AUDIT_MODEL = claude-opus-4-7 ← top tier
ENGINE_ACTION_MODEL = claude-sonnet-4-6
ENGINE_SINGLE_MODEL = claude-opus-4-7 ← single-reviewer
Opus 4.8 is a drop-in over 4.7 (same request surface, no new breaking changes — model-ID swap + prompt re-tune). Fable 5 raises the capability ceiling for the audit/single-reviewer tier where correctness matters most. We should evaluate the capability/cost tradeoff and enable each where it pays off.
Model reference (verified via the claude-api skill catalog)
| Model | ID | Context | Max out | $/1M in | $/1M out |
|---|---|---|---|---|---|
| Claude Fable 5 | claude-fable-5 |
1M | 128K | $10 | $50 |
| Claude Opus 4.8 | claude-opus-4-8 |
1M | 128K | $5 | $25 |
| Claude Sonnet 4.6 | claude-sonnet-4-6 |
1M | 64K | $3 | $15 |
| Claude Haiku 4.5 | claude-haiku-4-5 |
200K | 64K | $1 | $5 |
API surface notes for Fable 5 / Opus 4.8 (both engines must honor these):
- Adaptive thinking only —
thinking:{type:"adaptive"};budget_tokensandtemperature/top_p/top_kare removed (400 if sent). - Thinking depth/spend via
output_config.effort(low|medium|high|xhigh|max). - Fable 5 only: an explicit
thinking:{type:"disabled"}returns 400 — omit thethinkingparam entirely instead. - Min cacheable prefix: Fable 5 = 2048 tok; Opus 4.8 = 4096 tok.
Dependency (blocking)
- bug(dev-lead): engine.sh defines multi-tier model pipeline but all tasks always invoke ENGINE_ACTION_MODEL (sonnet-4-6) #195 — the multi-tier pipeline in
engine.shis currently inert: every dev-lead intent routes throughrun_writer_with_fallback→ENGINE_ACTION_MODEL, and the rate-limit failover detection is broken. Enabling a higher-cost top tier (Fable 5 / Opus 4.8) only delivers value once bug(dev-lead): engine.sh defines multi-tier model pipeline but all tasks always invoke ENGINE_ACTION_MODEL (sonnet-4-6) #195 is fixed and tasks route by capability. Fix bug(dev-lead): engine.sh defines multi-tier model pipeline but all tasks always invoke ENGINE_ACTION_MODEL (sonnet-4-6) #195 first (or land both together).
Proposed approach
- Model registry / config — introduce
claude-opus-4-8andclaude-fable-5as configurable per-tier defaults; keep the existingCLAUDE_*_MODEL_CHAINfallback variables as the safe path (e.g. audit/single →claude-fable-5,claude-opus-4-8,claude-opus-4-7). - Capability-aware selection — route by task type: triage→Haiku, deep/action→Sonnet 4.6/Opus 4.8, audit/single-reviewer→Fable 5 (or Opus 4.8) where correctness > cost. Fail closed (no silent downgrade unless the fallback chain is explicitly enabled).
- Request-surface compatibility — ensure both engines emit adaptive thinking +
effort, neverbudget_tokens/sampling params, and omitthinkingrather than disabling it on Fable 5. - Observability — log per-run model ID, tier, token usage, and fallback hops (ties into the Token Cost Observatory, 📊 Token Cost Observatory — Weekly Report #464).
- Staged rollout — ride the Initiative: Safe Release Strategy for Agentic Workflows (versioning · rings · canary) #495 ring strategy: opt-in → one agent → both. Do not blind-flip the self-hosting agents' top tier.
Deliverables
engine.shper-tier config + fallback chains updated for Fable 5 / Opus 4.8.- Capability/cost routing with explicit fail-closed behavior.
- Adaptive-thinking + effort emitted correctly for the new models (no removed params).
shellcheck-clean; smoke test each tier resolves and falls back.- Rollout notes + env-var examples.
Acceptance criteria
dev-leadandpr-reviewcan run onclaude-opus-4-8andclaude-fable-5per tier, in non-prod and prod, behind the fallback chains.- No use of removed params (
budget_tokens,temperature,top_p,top_k); Fable 5 omitsthinkingrather than disabling it. - Capability routing actually executes (i.e. bug(dev-lead): engine.sh defines multi-tier model pipeline but all tasks always invoke ENGINE_ACTION_MODEL (sonnet-4-6) #195 resolved) — top tier is reachable, not dead code.
- Cost/latency deltas measured and documented per tier.
Related
- Discussion Enable enhanced model selection for agents #413 — "Enable enhanced model selection for agents" (origin of this work)
- Enhance dev-lead and pr-review engines for Gemini 3.5 models #382 — same enhancement for the Gemini 3.5 engine
- bug(dev-lead): engine.sh defines multi-tier model pipeline but all tasks always invoke ENGINE_ACTION_MODEL (sonnet-4-6) #195 — prerequisite: tier pipeline inert + broken failover
- Initiative: Safe Release Strategy for Agentic Workflows (versioning · rings · canary) #495 — Safe Release Strategy (ring-staged rollout for agent self-host)
- 📊 Token Cost Observatory — Weekly Report #464 — Token Cost Observatory (observability sink)
Per the Release Strategy initiative, Phase 1 is human-driven: the model bump should be cut and promoted by a human through the rings, not auto-rolled.
Activity
github-actions commentedon Jun 10, 2026
Thanks for the detailed write-up — the tier-by-tier breakdown, API surface notes, and rollout plan make the scope very clear! This is queued for review. One question before scoping the work: since #195 (broken tier routing + rate-limit failover) is listed as a hard prerequisite — without it the new top-tier slots are unreachable dead code — do you intend to land #195 and this issue together in a single PR, or should this issue stay blocked until #195 merges independently?
don-petry commentedon Jun 11, 2026
Cross-link — ideation output. The feature-ideation workflow (now running in this repo, #555) generated two proposals that align with this issue's scope:
engine.shModel ChainsCanonical discussion remains #413. Both proposals reinforce the capability/cost-aware selection this issue tracks (still gated on #195).
don-petry commentedon Jun 11, 2026
Dev-Lead Implementation Plan
Issue: #553 — Enable new Claude models (Fable 5 / Opus 4.8) in dev-lead + pr-review engines with capability-aware selection
Scope
Wire
claude-fable-5andclaude-opus-4-8intoscripts/engine.shper-tier config and fallback chains, add pricing tomodel-pricing.tsv, and update the test suite to cover the new model routing.Implementation Checklist
scripts/engine.sh— updateENGINE_DEEP_MODEL→claude-opus-4-8,ENGINE_AUDIT_MODELandENGINE_SINGLE_MODEL→claude-fable-5; update fallback chains; update labelsscripts/lib/model-pricing.tsv— addclaude-fable-5pricing row ($10/$1/$12.50/$50 per MTok)tests/dev-lead/unit/test_engine_new_models.bats— new test file (TDD): verify new tier defaults, new chain order, fable-5 fallback behaviourtests/dev-lead/unit/test_engine_chain.bats— update stale tests that hardcodeclaude-opus-4-7in chain positions that now useclaude-opus-4-8/claude-fable-5Tests to Write (
tests/dev-lead/unit/test_engine_new_models.bats)ENGINE_AUDIT_MODEL = claude-fable-5on claude engineENGINE_SINGLE_MODEL = claude-fable-5on claude engineENGINE_DEEP_MODEL = claude-opus-4-8on claude engineENGINE_ACTION_MODELunchanged (stillclaude-sonnet-4-6)ENGINE_TRIAGE_MODELunchanged (stillclaude-haiku-4-5-20251001)CLAUDE_AUDIT_MODEL_CHAINstarts withclaude-fable-5CLAUDE_SINGLE_MODEL_CHAINstarts withclaude-fable-5CLAUDE_DEEP_MODEL_CHAINstarts withclaude-opus-4-8CLAUDE_ACTION_MODEL_CHAINsecond element isclaude-opus-4-8(not opus-4-7)model_for_intent("fix-issue")returnsclaude-opus-4-8model_for_intent("fix-reviews")still returnsclaude-sonnet-4-6Existing Tests to Update
test_engine_chain.bats:123—CLAUDE_ACTION_MODEL_CHAINfallback now opus-4-8 (not opus-4-7)test_engine_chain.bats:136— both-rate-limited test references opus-4-7; update to opus-4-8test_engine_chain.bats:160— deep tier default now opus-4-8; update stub map and assertiontest_engine_chain.bats:171— audit tier default now fable-5; update stub map and assertiontest_engine_chain.bats:262— writer non-RL propagation test; update to opus-4-8 in chaintest_engine_chain.bats:313— "passing tier default model expands to chain" — update to opus-4-8 deep defaultTest Command
bats tests/dev-lead/unit/test_engine_chain.bats tests/dev-lead/unit/test_engine_new_models.bats tests/dev-lead/unit/test_model_dispatch.bats tests/model_pricing.batsdon-petry commentedon Jun 11, 2026
Dev-Lead: Implementation Complete
Plan Execution
scripts/engine.sh—ENGINE_DEEP_MODEL→claude-opus-4-8;ENGINE_AUDIT_MODEL/ENGINE_SINGLE_MODEL→claude-fable-5; fallback chains updated; labels updatedscripts/lib/model-pricing.tsv— addedclaude-fable-5*at $10 / $1 / $12.50 / $50 per MTok (effective 2026-06-11);claude-opus-4-8is covered by existingclaude-opus-4-*glob at $5/$25tests/dev-lead/unit/test_engine_new_models.bats— 22 new tests: tier defaults, chain order, fallback behavior, dispatch routing, non-claude engines unchangedtests/dev-lead/unit/test_engine_chain.bats— updated 8 stale tests that hardcoded pre-existing model IDs in chain positions now occupied by opus-4-8 / fable-5; addedunsetof pre-set chain vars tosetup()in both test filesTier mapping after this change
claude-haiku-4-5-20251001haiku,sonnet-4-6(unchanged)claude-sonnet-4-6sonnet-4-6,opus-4-8claude-opus-4-8opus-4-8,sonnet-4-6claude-fable-5fable-5,opus-4-8,opus-4-7claude-fable-5fable-5,opus-4-8,opus-4-7Env-var override examples
API surface notes (Fable 5 / Opus 4.8)
No params were removed — the engine.sh CLI invocations (
claude --print --model) have never passedbudget_tokens,temperature,top_p, ortop_k. The Claude CLI handles adaptive thinking natively for new models. No--thinkingdisable flag is passed, so Fable 5's 400-on-disabled constraint is already satisfied.Test Results
Files Changed
scripts/engine.sh: tier models promoted to fable-5 / opus-4-8; fallback chains extended; Fable 5 API constraint comment addedscripts/lib/model-pricing.tsv:claude-fable-5*pricing row addedtests/dev-lead/unit/test_engine_new_models.bats: new test file (22 tests)tests/dev-lead/unit/test_engine_chain.bats: 8 tests updated to reflect new chain positions;setup()clears pre-set chain env varsNotes
claude-opus-4-*glob already prices it at $5/$0.50/$6.25/$25 per MTok (same pricing as 4.7).CLAUDE_*_MODEL_CHAINvars from its own engine.sh invocation;setup()now unsets them so each test evaluates the code's current defaults rather than the runner's stale config.feat: implement issue #553 — Enable new Claude models (Fable 5 / Opus…
feat: implement issue #553 — Enable new Claude models (Fable 5 / Opus…
feat: implement issue #553 — Enable new Claude models (Fable 5 / Opus…
feat: implement issue #553 — Enable new Claude models (Fable 5 / Opus…
feat: implement issue #553 — Enable new Claude models (Fable 5 / Opus…
feat: implement issue #553 — Enable new Claude models (Fable 5 / Opus…