fix: probe correct 5th-gen model IDs so Opus 5 appears in the model list - #520
Conversation
Model discovery CLI-probes a hardcoded candidate list, and the 5th-gen entries were guessed as `claude-opus-5-0` / `claude-sonnet-5-0`. Those IDs don't exist — the 5th generation uses dateless, single-number IDs (`claude-opus-5`), the same convention as `claude-fable-5`, which the list already probed correctly. Every Opus 5 probe failed silently, so the discovered list capped out at Opus 4.8 and the UI never offered Opus 5. Verified against the CLI: `claude-opus-5` and `claude-sonnet-5` resolve; `claude-opus-5-0`, `claude-sonnet-5-0`, `claude-opus-4-9` and `claude-sonnet-4-8` all error as nonexistent, so the dead guesses are dropped and `claude-opus-6` / `claude-sonnet-6` become the probe-ahead entries. Also adds Opus 5 and Sonnet 5 to both fallback lists, Opus 5 first — `getDefaultClaudeModel()` returns entry [0], so new sessions now start on Opus 5 instead of Opus 4.8. Note this path only runs because codekin has no ANTHROPIC_API_KEY in its env; with a key the API strategy would return the full catalog and no hardcoded list would be needed. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QNbRcczwaByehnDvarQFFu
CI #1279's `Audit dependencies` step failed on the root workspace with two newly-published advisories against versions the lockfile had pinned: - brace-expansion <=5.0.7 (high) — GHSA-mh99-v99m-4gvg, unbounded expansion length causing an OOM crash. The lockfile sat at exactly 5.0.7; 5.0.8 is the patched release. This is the one that tripped `--audit-level=high`. - @babel/core <=7.29.0 (low) — GHSA-4x5r-pxfx-6jf8, arbitrary file read via sourceMappingURL comment. Pulled in transitively by eslint-plugin-react-hooks (^7.24.4); 7.29.7 is the patched 7.x. brace-expansion was already an override, so bumping the range to ^5.0.8 and re-resolving was enough. @babel/core is transitive only, so it gets a new override pinned to the 7.x line rather than 8.x, keeping it inside the `^7.24.4` and `^7.0.0` ranges its dependents declare. No source changes; lint, build and the full 2497-test suite pass. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
CI #1279 fix — dependency audit, not the model-discovery changeThe failure was unrelated to this PR's source change. The
Only Changes (93918db)
Unrelated noteBoth jobs also emit an annotation that |
The previous bump fixed the root tree, but CI audits both — `npm audit` then `cd server && npm audit`. The server tree still failed on postcss (high, GHSA-r28c-9q8g-f849), pulled in transitively via vite, so CI stayed red. Adds a `postcss: ^8.5.18` override alongside the existing `vite` one, matching how brace-expansion/@babel/core are pinned at the root. Resolves to 8.5.23. Both trees now report 0 vulnerabilities; lint, root build and server build all pass. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QNbRcczwaByehnDvarQFFu
|
CI #1280 fix — Root cause. The step runs two audits:
Fix. Added a Verification. Reproduced the exact failure on the pre-change lockfile and confirmed it clears afterwards. Both workspaces now report 0 vulnerabilities at Gotcha worth recording. Sandboxes that export Note: a parallel session pushed fd4cd9d with byte-identical content while I was verifying. I confirmed the trees matched exactly and dropped my duplicate commit rather than adding noise. |
Problem
Opus 5 never showed up in codekin's model selector, even though the installed Claude Code CLI supports it.
Model discovery in
server/anthropic-models.tshas two strategies. The Anthropic API path is inert here — codekin's process env has noANTHROPIC_API_KEY/CLAUDE_CODE_API_KEY, sofetchViaApi()returnsnullimmediately. That leaves CLI probing, which spawnsclaude -p --model <id>over a hardcoded candidate list.That list guessed the 5th-generation IDs with a
-0suffix:The 5th generation uses dateless, single-number IDs — the same convention as
claude-fable-5, which the list already probed correctly. So every Opus 5 probe failed silently, discovery capped out at Opus 4.8, and the UI showed that as newest.Verified against the CLI
claude-opus-5modelUsage=claude-opus-5)claude-sonnet-5modelUsage=claude-sonnet-5)claude-opus-5-0claude-sonnet-5-0claude-opus-4-9claude-haiku-5Changes
claude-opus-5,claude-sonnet-5,claude-haiku-5.claude-opus-4-9/claude-sonnet-4-8; addedclaude-opus-6/claude-sonnet-6as the new probe-ahead entries.-0guess doesn't reappear.FALLBACK_MODELS,CLAUDE_MODELS), Opus 5 first —getDefaultClaudeModel()returns entry[0], so new sessions now start on Opus 5 instead of Opus 4.8.Testing
server/anthropic-models.test.ts: 12/12 pass (tests referenceFALLBACK_MODELSsymbolically and mock the probe set, so they're insensitive to list contents).GET /api/claude/modelsnow returns Opus 5 first.Follow-up (not in this PR)
The underlying fragility remains: a hardcoded guess list needs manual edits for every new model family. Setting
ANTHROPIC_API_KEYin codekin's env would make the API strategy return the full catalog and retire the guessing entirely.🤖 Generated with Claude Code
https://claude.ai/code/session_01QNbRcczwaByehnDvarQFFu