feat(ai): add Claude Opus 5 and Fable 5 across providers and review agents - #1151
Merged
Conversation
Adds `claude-opus-5` to both static Claude model lists: - `packages/ai/providers/claude-agent-sdk.ts` — the Ask AI picker - `packages/ui/components/AgentsTab.tsx` — the review-agent picker, which `TOUR_CLAUDE_MODELS` spreads, so tour and guide pick it up too No `claude-opus-5[1m]` variant: the `[1m]` suffix opts the 4.x models into the larger context window, and the 5-series models are already 1M by default — which is why the existing `claude-fable-5` and `claude-sonnet-5` entries carry no variant either. A test pins that invariant. Guide, tour, and marker review need no change — they pass the picked model straight through to the CLI with no server-side allowlist. Tests cover the Bedrock/Vertex family matcher accepting the new bare alias (a matcher keyed on "opus-4" would have silently dropped it) and pin the existing Fable fallthrough, which has no ANTHROPIC_DEFAULT_*_MODEL of its own. Also refreshes the marketing Ask AI model list, which had gone stale at Sonnet 4.6 / Opus 4.6 / Haiku 4.5.
Bumps the two Claude review-agent defaults from Opus 4.7 to Opus 5: - `DEFAULT_CLAUDE_MODEL` (packages/ui/hooks/useAgentSettings.ts) — the review-agent picker's default for users with no saved cookie preference - `buildClaudeCommand`'s default parameter (packages/server/claude-review.ts) — the server-side fallback when a job arrives with no model BEHAVIOR CHANGE: users who have never picked a Claude review model move from Opus 4.7 to Opus 5. Saved picks are untouched — the cookie already holds an explicit model for anyone who has chosen one. Kept deliberately separate from the catalog commit so it can be reverted on its own if the maintainer prefers to ship the new models as options only. Ask AI's default (`DEFAULT_MODEL` in claude-agent-sdk.ts) stays on Sonnet 5, and the tour/guide defaults stay on the `sonnet` latest-alias — those are interactive, latency-sensitive surfaces where the cheaper tier is the intentional choice.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this adds
claude-opus-5("Opus 5") in both static Claude model catalogs:packages/ai/providers/claude-agent-sdk.tspackages/ui/components/AgentsTab.tsx(CLAUDE_MODELS)TOUR_CLAUDE_MODELSspreads it, so Code Tour and Guided Review inherit itFable 5 was already present in both lists, so this PR only adds Opus 5. Nothing else was needed for guides/tours/marker review: those pass the picked model straight through to the CLI and there is no server-side model allowlist anywhere in the repo.
No
claude-opus-5[1m]variantThe
[1m]suffix exists to opt the 4.x models into the larger context window. The 5-series models are 1M by default, which is why the existingclaude-fable-5andclaude-sonnet-5entries carry no variant either. Adding one would have been the odd entry out.AgentsTab.test.tsnow pins that invariant so a future entry doesn't invent one.Matcher verification
resolveSDKModel(the Bedrock/Vertex mapper) matches on the substring"opus", soclaude-opus-5routes toANTHROPIC_DEFAULT_OPUS_MODELcorrectly — but a matcher keyed on"opus-4"would have silently dropped it, so there are now tests for the bare alias on both Bedrock and Vertex, plus off-cloud passthrough. Also pinned the pre-existing Fable fallthrough (Claude Code defines onlyANTHROPIC_DEFAULT_{OPUS,SONNET,HAIKU}_MODEL, so Fable falls back toANTHROPIC_MODEL— deliberate, not a missed branch).c1442797bumps the Claude review-agent default fromclaude-opus-4-7toclaude-opus-5in two places:DEFAULT_CLAUDE_MODEL(useAgentSettings.ts) andbuildClaudeCommand's default parameter (claude-review.ts).Users with a saved cookie pick are unaffected; users who never picked move from Opus 4.7 to Opus 5. It's isolated in its own commit —
git revert c1442797drops it and leaves the new models as options only.Not changed, deliberately: Ask AI's
DEFAULT_MODEL(alreadyclaude-sonnet-5), and the tour/guide Claude defaults (thesonnetlatest-resolving alias) — those are latency-sensitive interactive surfaces where the cheaper tier is intentional.Two-runtime law
claude-agent-sdk.ts,claude-review.ts, andmarker-review.tsare all auto-vendored into the Pi extension byapps/pi-extension/vendor.sh(whichbun run typecheckinvokes).apps/pi-extension/generated/is gitignored, so there is nothing to hand-mirror. Verified the vendored copy carries the new entry and thatapps/pi-extensiontests pass.Tests
bun run typecheck(incl. vendor.sh + pi-extension)bun test packages/ai packages/ui packages/serverbun test apps/pi-extensionPart A — full hardcoded-model-slug inventory (click to expand)
Swept
packages/,apps/,tests/, marketing content and skills for every provider's slugs (claude-*,gpt-*,o3/o4-*,gemini-*, cursor/copilot/pi/opencode patterns), excludingnode_modulesanddist. 173 matching lines across 18 files. Nogemini-*,o3/o4-*,grok,deepseek, orqwenslugs exist anywhere in the repo.Sources of truth
packages/ai/providers/claude-agent-sdk.ts→modelsarray/api/ai/capabilities→ UI pickerpackages/ui/components/AgentsTab.tsx→CLAUDE_MODELSTOUR_CLAUDE_MODELS(tour + guide),GuideEmptyState.tsxpackages/ui/utils/codexModels.ts→CODEX_MODELSAgentsTab.tsx; efforts clamped inuseAgentSettings.tspackages/ai/providers/codex-app-server.ts→modelsarray/api/ai/capabilitiesagent models,copilot help config,opencode models, Pi RPC)There is no server-side model allowlist — model strings pass through to the spawned CLI verbatim. Adding a picker entry is therefore sufficient to make a model launchable everywhere.
Claude slugs
packages/ai/providers/claude-agent-sdk.ts:58claude-sonnet-5…claude-agent-sdk.ts:167-178packages/ui/components/AgentsTab.tsx:32-42packages/ui/hooks/useAgentSettings.ts:19claude-opus-4-7→claude-opus-5packages/server/claude-review.ts:220claude-opus-4-7→claude-opus-5useAgentSettings.ts:26,32sonnetpackages/server/marker-review.ts:780-781claude-sonnet-5,gpt-5.5copilot help configoutputpackages/server/marker-review.test.ts:152-237claude-sonnet-5,claude-opus-4-8-thinking-highpackages/ai/ai.test.ts:860-921packages/ai/providers/pi-sdk.ts:293anthropic/claude-haiku-4-5Non-Claude slugs
packages/ai/providers/codex-app-server.ts:48,530gpt-5.6-solpackages/ui/utils/codexModels.ts:32-46useAgentSettings.ts:23,28,36gpt-5.5useAgentSettings.ts:206-215gpt-5.6→gpt-5.6-sol,gpt-5.1-codex-mini→gpt-5.4-mini; retired setpackages/server/marker-review.test.ts:88-126gpt-5--modelfixturepackages/server/fixtures/pi-insufficient-credits.ndjsonopenai/gpt-5.5tests/manual/local/*.sh:27,68,37gpt-5.4-miniStale slugs found in docs (the riskiest items)
apps/marketing/…/guides/ai-features.md:21-23apps/marketing/…/guides/ai-features.md:31-36gpt-5.5, and 5.3-codex/5.2-codex are retired. Not fixed — out of scope for a Claude PR; worth a follow-up.apps/marketing/…/reference/api-endpoints.md:53claude-3-5-sonnetagentSwitchJSON example, not a model catalog, so left alone — flagging for a docs pass.apps/pi-extension/README.md:101,116+config.test.ts:146claude-sonnet-4-5Checked and found to need nothing
fastModeis only ever set fromcodexFast). There is no Claude fast-mode toggle to extend to Opus 5/4.8/4.7, so nothing to gate.Default-only fallbacks.packages/ui/utils/codexModels.tseffort clamping is per-Codex-model and unaffected.