Skip to content

feat(ai): add Claude Opus 5 and Fable 5 across providers and review agents - #1151

Merged
backnotprop merged 2 commits into
mainfrom
feat/claude-opus-5-models
Jul 29, 2026
Merged

feat(ai): add Claude Opus 5 and Fable 5 across providers and review agents#1151
backnotprop merged 2 commits into
mainfrom
feat/claude-opus-5-models

Conversation

@backnotprop

Copy link
Copy Markdown
Owner

What this adds

claude-opus-5 ("Opus 5") in both static Claude model catalogs:

File Surface
packages/ai/providers/claude-agent-sdk.ts Ask AI model picker
packages/ui/components/AgentsTab.tsx (CLAUDE_MODELS) Review-agent picker — TOUR_CLAUDE_MODELS spreads it, so Code Tour and Guided Review inherit it

Fable 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] variant

The [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 existing claude-fable-5 and claude-sonnet-5 entries carry no variant either. Adding one would have been the odd entry out. AgentsTab.test.ts now pins that invariant so a future entry doesn't invent one.

Matcher verification

resolveSDKModel (the Bedrock/Vertex mapper) matches on the substring "opus", so claude-opus-5 routes to ANTHROPIC_DEFAULT_OPUS_MODEL correctly — 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 only ANTHROPIC_DEFAULT_{OPUS,SONNET,HAIKU}_MODEL, so Fable falls back to ANTHROPIC_MODEL — deliberate, not a missed branch).

⚠️ Behavior change — commit 2, revert if unwanted

c1442797 bumps the Claude review-agent default from claude-opus-4-7 to claude-opus-5 in two places: DEFAULT_CLAUDE_MODEL (useAgentSettings.ts) and buildClaudeCommand'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 c1442797 drops it and leaves the new models as options only.

Not changed, deliberately: Ask AI's DEFAULT_MODEL (already claude-sonnet-5), and the tour/guide Claude defaults (the sonnet latest-resolving alias) — those are latency-sensitive interactive surfaces where the cheaper tier is intentional.

Two-runtime law

claude-agent-sdk.ts, claude-review.ts, and marker-review.ts are all auto-vendored into the Pi extension by apps/pi-extension/vendor.sh (which bun run typecheck invokes). apps/pi-extension/generated/ is gitignored, so there is nothing to hand-mirror. Verified the vendored copy carries the new entry and that apps/pi-extension tests pass.

Tests

Suite Result
bun run typecheck (incl. vendor.sh + pi-extension) pass
bun test packages/ai packages/ui packages/server 1015 pass / 0 fail
bun test apps/pi-extension 137 pass / 0 fail
Part 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), excluding node_modules and dist. 173 matching lines across 18 files. No gemini-*, o3/o4-*, grok, deepseek, or qwen slugs exist anywhere in the repo.

Sources of truth

Provider Single source of truth Flows to
Claude — Ask AI packages/ai/providers/claude-agent-sdk.tsmodels array /api/ai/capabilities → UI picker
Claude — review agents packages/ui/components/AgentsTab.tsxCLAUDE_MODELS TOUR_CLAUDE_MODELS (tour + guide), GuideEmptyState.tsx
Codex packages/ui/utils/codexModels.tsCODEX_MODELS re-exported through AgentsTab.tsx; efforts clamped in useAgentSettings.ts
Codex — Ask AI packages/ai/providers/codex-app-server.tsmodels array /api/ai/capabilities
Cursor / Copilot / OpenCode / Pi none — discovered at runtime (agent models, copilot help config, opencode models, Pi RPC) capability payload; UI consts are fallbacks only

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

File:line Slug Role Staleness
packages/ai/providers/claude-agent-sdk.ts:58 claude-sonnet-5 Ask AI default current
…claude-agent-sdk.ts:167-178 fable-5, opus-5 (added), opus-4-8(+1m), sonnet-5, sonnet-4-6(+1m), opus-4-7(+1m), opus-4-6(+1m), haiku-4-5 picker entries topped out at Opus 4.8 before this PR
packages/ui/components/AgentsTab.tsx:32-42 same set picker entries same
packages/ui/hooks/useAgentSettings.ts:19 claude-opus-4-7claude-opus-5 review default was 2 generations stale
packages/server/claude-review.ts:220 claude-opus-4-7claude-opus-5 server default param was 2 generations stale
useAgentSettings.ts:26,32 sonnet tour/guide default (latest-resolving alias) self-updating
packages/server/marker-review.ts:780-781 claude-sonnet-5, gpt-5.5 docstring example of copilot help config output current
packages/server/marker-review.test.ts:152-237 claude-sonnet-5, claude-opus-4-8-thinking-high copilot fixtures fine — fixtures, not a catalog
packages/ai/ai.test.ts:860-921 sonnet-4-6, opus-4-8[1m], haiku-4-5, sonnet-4-5 ARNs Bedrock ARN fixtures fine — arbitrary ARN strings
packages/ai/providers/pi-sdk.ts:293 anthropic/claude-haiku-4-5 docstring format example fine

Non-Claude slugs

File:line Slug(s) Role Staleness
packages/ai/providers/codex-app-server.ts:48,530 gpt-5.6-sol Ask AI Codex default + only entry current
packages/ui/utils/codexModels.ts:32-46 gpt-5.6-{sol,terra,luna}, 5.5, 5.4, 5.3-codex-spark, 5.2, 5.4-mini Codex catalog current; retirements documented inline
useAgentSettings.ts:23,28,36 gpt-5.5 Codex review/tour/guide defaults current
useAgentSettings.ts:206-215 gpt-5.6gpt-5.6-sol, gpt-5.1-codex-minigpt-5.4-mini; retired set migration maps current, actively maintained
packages/server/marker-review.test.ts:88-126 gpt-5 cursor --model fixture fine — arbitrary string
packages/server/fixtures/pi-insufficient-credits.ndjson openai/gpt-5.5 Pi error-stream fixture fine
tests/manual/local/*.sh:27,68,37 gpt-5.4-mini manual e2e script default slightly stale, not shipped

Stale slugs found in docs (the riskiest items)

File:line Slug Assessment
apps/marketing/…/guides/ai-features.md:21-23 Sonnet 4.6 / Opus 4.6 / Haiku 4.5 Riskiest — public-facing and 3 generations stale. Predated Fable 5, Sonnet 5, Opus 4.7, Opus 4.8. Fixed in this PR.
apps/marketing/…/guides/ai-features.md:31-36 GPT-5.4 (default), 5.3 Codex, 5.2 Codex Stale — the real default is gpt-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:53 claude-3-5-sonnet Retired model (Oct 2025) in a public API example. It's an agentSwitch JSON example, not a model catalog, so left alone — flagging for a docs pass.
apps/pi-extension/README.md:101,116 + config.test.ts:146 claude-sonnet-4-5 Pi's own agent-config example, unrelated to Plannotator's pickers. Correctly left alone.

Checked and found to need nothing

  • Fast mode is Codex-only in Plannotator (fastMode is only ever set from codexFast). There is no Claude fast-mode toggle to extend to Opus 5/4.8/4.7, so nothing to gate.
  • Guide / tour / marker review carry no model catalogs — they take the model from settings and forward it.
  • Cursor / Copilot / OpenCode / Pi catalogs are runtime-discovered; their in-repo consts are Default-only fallbacks.
  • packages/ui/utils/codexModels.ts effort clamping is per-Codex-model and unaffected.

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.
@backnotprop
backnotprop merged commit b752080 into main Jul 29, 2026
13 checks passed
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.

1 participant