Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

bump seeded Claude CLI/TUI + Bedrock providers to claude-opus-5

[._.]/ Adam Eivyd4eb66466f3c
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index 4d949e84df..8bcefb6d31 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -154,3 +154,4 @@
- **Flag a missing walk strip instead of rendering a silent blank card** — a sprite direction whose packed `…-strip.png` had gone missing on disk (how `pioneer`'s `north`/`west` strips vanished — dropped during a `grok/`→`runs/` relocation while the record still advertised the path) rendered its "approved" badge over an empty cell: `getWalkState`'s native run path handed the client a `stripPreview.stripPath` that 404'd into a blank CSS-`background-image` `StripLoop`, unlike `loadRedrawRun` which already returns null on a missing strip. `getWalkState` now checks the strip on disk (`normalizeMissingStrip`, mirroring the existing `normalizeStaleRendering` read-time normalization — never persisted) and, when absent, flags the run `stripMissing: true` and drops the dangling `stripPath` so `StripLoop`/the trim button don't render it. The walk card shows an explicit "strip missing" indicator pointing at the recovery that actually works for that direction's state — **regenerate** an unapproved/unfinalized direction, **unlock** a finalized set — rather than overloading the run's `error` status (which would offer a "Retry postprocess" that 409s on a finalized/approved direction and pair a red error with the green "approved" ✓). As defense-in-depth (a background-image fires no `onError`), `StripLoop` also preloads the strip via an `Image` probe and shows a placeholder if it fails to load for any other reason.
- **Variable walk-cycle frame count + adjustable walking speed, reprocessable from the clip already on disk** — walk cycles were hardcoded to 8 frames at 12fps, a 0.67s cycle that reads as a run rather than a walk. Two knobs are now user-controlled in the Walk Cycles panel: **frame count** (6–16, default 12 — more frames = smoother) and **playback speed** (4–24 fps, default 10 — lower = slower/more deliberate), with a live "N.NNs / cycle" readout. The deterministic packer resamples the detected gait window *down* to the chosen count (it never upsamples — the count is bounded by the source frames in one cycle) and stamps the chosen fps as playback metadata, so a slower, smoother walk needs **no regeneration**: a per-candidate "Reprocess" rebuilds the loop from the clip already on disk at the current count/speed with no grok call. The runtime atlas grid follows the set's actual frame count (idle + N walk phases), read from the approved run manifests and required identical across all eight directions, with `walkFrameCount`/`walkFps` stamped into the geometry manifest for the external game to read; the historical 8-frame packing keeps its named 2-beat gait-phase labels for byte-identical back-compat. A new per-direction **Reopen** re-opens just one approved direction (finer-grained than the whole-set Unlock) so a single too-fast walk can be redone without disturbing the other seven. The Clip length picker now offers only grok's real 6s/10s options — shorter values were a silent no-op (grok clamps to ~6s), and clip length only affects how much source footage the packer has to choose from, not the cycle's look.
- **Render the sprite turnaround sheet as a large square instead of a wasteful strip** — the locked "identity root" turnaround preview in the Reference workflow used a fixed 192×128 landscape box, but the sheet is a square PNG (four figures in a 1:1 canvas); `object-contain` letterboxed it into a ~128px center strip and wasted the sides. It now renders as a large responsive square (`w-full max-w-sm aspect-square`, stacking the "frozen · identity root" caption below it on mobile), so the four-view sheet is shown as big as its column allows. The candidate thumbnails and locked directional-anchor previews (also square PNGs previously fit into short `h-24` boxes) switch to `aspect-square` too, so every reference image in the panel fills its cell instead of floating in a center band.
+- **[claude-default-opus-5] Default Claude CLI/TUI and Bedrock providers now use `claude-opus-5`.** The seeded `claude-code`, `claude-code-tui`, `claude-code-bedrock`, and `claude-code-tui-bedrock` providers ship the new opus tier as their default/heavy model (`claude-opus-5`; Bedrock: `global.anthropic.claude-opus-5[1m]`), and `claude-opus-5` leads the Anthropic API model-refresh list. The Bedrock `[1m]` long-context variant is carried forward and mapped like-for-like — a box pinned to `…opus-4-8[1m]` lands on `…opus-5[1m]`, one pinned to the plain id lands on the plain id — so the bump never silently changes which context tier a Bedrock request asks for. `data.reference/providers.json`, the aiToolkit sample defaults, and the PortOS scaffolder are updated together, and migration `206-claude-default-opus-5.js` rewrites existing installs' `data/providers.json` on the next `update.sh` — conservatively, matching migration 058/153: only an exact match on the prior seeded model list is rewritten (a curated list is left alone), a tier pointer still parked on a now-absent opus-4-8 id is repaired on its own, and still-current haiku/sonnet pins are preserved. `claude-opus-5` is added to the usage cost table at Opus-tier rates ($5/$25 per MTok), and the `/opus/i` family rule now reports it as the tier's rate anchor.
diff --git a/PLAN.md b/PLAN.md
index 61d91ddf0b..4a093008ef 100644
--- a/PLAN.md
+++ b/PLAN.md
@@ -310,3 +310,8 @@ is not reliably announced.
`jsx-a11y/aria-props`, `jsx-a11y/role-has-required-aria-props`,
`jsx-a11y/label-has-associated-control`) rather than the full `recommended` set.
+
+### Factor the "bump a seeded Claude provider tier" migration skeleton into `_lib.js`
+
+- [ ] `scripts/migrations/206-claude-default-opus-5.js` is the fourth hand-copy of the same shape (032 → 058 → 153 → 206): `diff 153-claude-default-sonnet-5.js 206-claude-default-opus-5.js` is identical apart from the data and comment prose — `POINTER_KEYS`, `sameArray`, the pointer-swap helper, and the entire `up()` body (read → ENOENT skip → `JSON.parse` guard → providers-map guard → three-way `touched`/`alreadyCurrent`/`customized` classification → conditional write → log) are byte-for-byte the same. Their co-located test files are ~200 structurally identical lines each. `scripts/migrations/_lib.js` is the documented home for exactly this — it already exports `makePromptReplaceMigration` ("every one from 003 onward collapses onto ~50 lines") and `makeSplitMigration` ("034/035/036/059 share the same skeleton and differ only in a handful of config values"), with `_testHelpers.js#runPromptMigrationTests` supplying the shared test cases. Add a `makeSeededProviderTierMigration({ targets, tierLabel })` plus a matching shared test runner so the *next* model bump is a ~25-line data table instead of ~370 re-cloned lines. Skipped in the opus-5 PR because migrations are append-only and frozen (a shipped migration must keep working against the shape it was written for), so this pays off from the migration *after* 206 forward and should not retro-edit 032/058/153 — which put it well outside that diff. Surfaced by two independent `/simplify` reviewers on the opus-5 change.
+- [ ] `server/lib/modelPricing.js` — all five `claude-opus-*` rows in `EXACT_RATES` carry an identical `[5.0, 25.0]`, so the `{ test: /opus/i, rateModel: '<latest opus>' }` line in `FAMILY_RULES` must be re-pointed at every model bump for zero behavioral effect (it only relabels the reported `rateModel` for *unrecognized* opus ids). A shared `const OPUS_TIER_RATES = [5.0, 25.0]`, or letting a family rule yield rates directly instead of pointing at a peer `EXACT_RATES` key, would retire that per-bump edit. Low value, listed for completeness.
diff --git a/client/src/utils/providers.js b/client/src/utils/providers.js
index 4737819a9e..9405126a93 100644
--- a/client/src/utils/providers.js
+++ b/client/src/utils/providers.js
@@ -33,6 +33,7 @@ const KNOWN_MODEL_CONTEXT_WINDOWS = Object.freeze([
[/gpt[-_.:/]?5\.4(?![-_.:/]?(?:mini|nano))(?:[-_.:/]|\b)/i, CODEX_CONTEXT_WINDOW],
[/claude[-_.:/]?fable[-_.:/]?5(?:[-_.:/]|\b)/i, 1_000_000],
[/claude[-_.:/]?mythos[-_.:/]?5(?:[-_.:/]|\b)/i, 1_000_000],
+ [/claude[-_.:/]?opus[-_.:/]?5(?:[-_.:/]|\b)/i, 1_000_000],
[/claude[-_.:/]?opus[-_.:/]?4[-_.:/]?8/i, 1_000_000],
[/claude[-_.:/]?sonnet[-_.:/]?5(?:[-_.:/]|\b)/i, 1_000_000],
[/claude[-_.:/]?sonnet[-_.:/]?4[-_.:/]?6(?:[-_.:/]|\b)/i, 1_000_000],
diff --git a/client/src/utils/providers.test.js b/client/src/utils/providers.test.js
index 5db172cf54..7f42d02c82 100644
--- a/client/src/utils/providers.test.js
+++ b/client/src/utils/providers.test.js
@@ -431,6 +431,8 @@ describe('effectiveModelContextWindow', () => {
expect(effectiveModelContextWindow({ type: 'tui' }, 'gpt-5.4')).toBe(1_000_000);
expect(effectiveModelContextWindow({ type: 'tui' }, 'gpt-5.4-mini')).toBe(400_000);
expect(effectiveModelContextWindow({ type: 'tui' }, 'gpt-5.4-nano')).toBe(128_000);
+ expect(effectiveModelContextWindow({ type: 'tui' }, 'claude-opus-5')).toBe(1_000_000);
+ expect(effectiveModelContextWindow({ type: 'tui' }, 'global.anthropic.claude-opus-5')).toBe(1_000_000);
expect(effectiveModelContextWindow({ type: 'tui' }, 'claude-opus-4-8')).toBe(1_000_000);
expect(effectiveModelContextWindow({ type: 'api', endpoint: 'https://api.example.test/v1' }, 'claude-sonnet-5')).toBe(1_000_000);
expect(effectiveModelContextWindow({ type: 'api', endpoint: 'https://api.example.test/v1' }, 'claude-sonnet-4-6')).toBe(1_000_000);
diff --git a/data.reference/providers.json b/data.reference/providers.json
index 78927a308a..171e10af40 100644
--- a/data.reference/providers.json
+++ b/data.reference/providers.json
@@ -7,11 +7,11 @@
"type": "cli",
"command": "claude",
"args": ["--print"],
- "models": ["claude-haiku-4-5", "claude-sonnet-5", "claude-opus-4-8"],
- "defaultModel": "claude-opus-4-8",
+ "models": ["claude-haiku-4-5", "claude-sonnet-5", "claude-opus-5"],
+ "defaultModel": "claude-opus-5",
"lightModel": "claude-haiku-4-5",
"mediumModel": "claude-sonnet-5",
- "heavyModel": "claude-opus-4-8",
+ "heavyModel": "claude-opus-5",
"timeout": 900000,
"enabled": true,
"envVars": {}
@@ -22,11 +22,11 @@
"type": "cli",
"command": "claude",
"args": ["--print"],
- "models": ["us.anthropic.claude-haiku-4-5", "us.anthropic.claude-sonnet-5", "global.anthropic.claude-opus-4-8", "global.anthropic.claude-opus-4-8[1m]"],
- "defaultModel": "global.anthropic.claude-opus-4-8[1m]",
+ "models": ["us.anthropic.claude-haiku-4-5", "us.anthropic.claude-sonnet-5", "global.anthropic.claude-opus-5", "global.anthropic.claude-opus-5[1m]"],
+ "defaultModel": "global.anthropic.claude-opus-5[1m]",
"lightModel": "us.anthropic.claude-haiku-4-5",
"mediumModel": "us.anthropic.claude-sonnet-5",
- "heavyModel": "global.anthropic.claude-opus-4-8[1m]",
+ "heavyModel": "global.anthropic.claude-opus-5[1m]",
"timeout": 900000,
"enabled": false,
"envVars": {
@@ -107,11 +107,11 @@
"type": "tui",
"command": "claude",
"args": ["--dangerously-skip-permissions"],
- "models": ["claude-haiku-4-5", "claude-sonnet-5", "claude-opus-4-8"],
- "defaultModel": "claude-opus-4-8",
+ "models": ["claude-haiku-4-5", "claude-sonnet-5", "claude-opus-5"],
+ "defaultModel": "claude-opus-5",
"lightModel": "claude-haiku-4-5",
"mediumModel": "claude-sonnet-5",
- "heavyModel": "claude-opus-4-8",
+ "heavyModel": "claude-opus-5",
"timeout": 900000,
"enabled": true,
"envVars": {},
@@ -124,11 +124,11 @@
"type": "tui",
"command": "claude",
"args": ["--dangerously-skip-permissions"],
- "models": ["us.anthropic.claude-haiku-4-5", "us.anthropic.claude-sonnet-5", "global.anthropic.claude-opus-4-8", "global.anthropic.claude-opus-4-8[1m]"],
- "defaultModel": "global.anthropic.claude-opus-4-8[1m]",
+ "models": ["us.anthropic.claude-haiku-4-5", "us.anthropic.claude-sonnet-5", "global.anthropic.claude-opus-5", "global.anthropic.claude-opus-5[1m]"],
+ "defaultModel": "global.anthropic.claude-opus-5[1m]",
"lightModel": "us.anthropic.claude-haiku-4-5",
"mediumModel": "us.anthropic.claude-sonnet-5",
- "heavyModel": "global.anthropic.claude-opus-4-8[1m]",
+ "heavyModel": "global.anthropic.claude-opus-5[1m]",
"timeout": 900000,
"enabled": false,
"envVars": { "CLAUDE_CODE_USE_BEDROCK": "1", "AWS_BEARER_TOKEN_BEDROCK": "" },
diff --git a/docs/TROUBLESHOOTING.md b/docs/TROUBLESHOOTING.md
index 554537f6f9..e996aa5b05 100644
--- a/docs/TROUBLESHOOTING.md
+++ b/docs/TROUBLESHOOTING.md
@@ -102,7 +102,7 @@ claude --version
- Verify model name matches provider's available models
- Check provider documentation for correct model identifiers
- Common models:
- - Claude: `claude-sonnet-5`, `claude-opus-4-8`, `claude-haiku-4-5-20251001`
+ - Claude: `claude-sonnet-5`, `claude-opus-5`, `claude-haiku-4-5-20251001`
- OpenAI: `gpt-5`, `gpt-5-mini`
- Ollama: Model must be pulled first (`ollama pull llama3`)
diff --git a/scripts/migrations/206-claude-default-opus-5.js b/scripts/migrations/206-claude-default-opus-5.js
new file mode 100644
index 0000000000..8857776835
--- /dev/null
+++ b/scripts/migrations/206-claude-default-opus-5.js
@@ -0,0 +1,170 @@
+/**
+ * Bump the Claude CLI/TUI (+ Bedrock) provider defaults from the
+ * `claude-opus-4-8` opus tier to `claude-opus-5`.
+ *
+ * The prior seeded shape (from migration 153 / the data.reference + scaffold
+ * + aiToolkit defaults) used `claude-opus-4-8` as the opus tier:
+ * claude-code / claude-code-tui
+ * models: ['claude-haiku-4-5', 'claude-sonnet-5', 'claude-opus-4-8']
+ * default/heavy: 'claude-opus-4-8'
+ * claude-code-bedrock / claude-code-tui-bedrock
+ * models: ['us.anthropic.claude-haiku-4-5', 'us.anthropic.claude-sonnet-5',
+ * 'global.anthropic.claude-opus-4-8', 'global.anthropic.claude-opus-4-8[1m]']
+ * default/heavy: 'global.anthropic.claude-opus-4-8[1m]'
+ *
+ * The new default swaps the opus tier to `claude-opus-5` (bedrock:
+ * `global.anthropic.claude-opus-5`). The Bedrock `[1m]` long-context variant is
+ * kept and mapped like-for-like — a user pinned to `…opus-4-8[1m]` lands on
+ * `…opus-5[1m]`, and one pinned to the plain id lands on the plain id — so the
+ * migration never silently changes which context tier a Bedrock box requests.
+ *
+ * Existing installs only pick this up if a migration rewrites their
+ * providers.json — `setup-data.js` merges *missing* provider entries but never
+ * updates existing ones.
+ *
+ * Conservative, matching migration 058/153's policy:
+ * - Only rewrite `models` when it matches the prior seeded trio/quartet
+ * EXACTLY (order-sensitive). A user who curated their own list is left
+ * alone.
+ * - When a rewrite happens, swap every retired opus id → its replacement
+ * wherever it appears (models array + any tier pointer). Tier pointers at
+ * still-current models (haiku, sonnet) are preserved.
+ * - Also handle the "already-new-models but stale opus-4-8 pointer" case:
+ * an install whose models already list opus-5 (fresh seed via the opus-5
+ * data.reference) but still has a tier pointer left on the now-absent
+ * opus-4-8 gets that orphan pointer repaired.
+ */
+
+import { readFile, writeFile } from 'fs/promises';
+import { join } from 'path';
+
+const PROVIDERS_REL_PATH = 'data/providers.json';
+
+const POINTER_KEYS = ['defaultModel', 'lightModel', 'mediumModel', 'heavyModel'];
+
+// Retired opus id → its replacement. Bedrock maps like-for-like so the `[1m]`
+// long-context pin survives the bump instead of silently dropping to the
+// standard-context id (or vice versa).
+const BARE_SPEC = {
+ oldModels: ['claude-haiku-4-5', 'claude-sonnet-5', 'claude-opus-4-8'],
+ opusMap: { 'claude-opus-4-8': 'claude-opus-5' },
+};
+const BEDROCK_SPEC = {
+ oldModels: [
+ 'us.anthropic.claude-haiku-4-5',
+ 'us.anthropic.claude-sonnet-5',
+ 'global.anthropic.claude-opus-4-8',
+ 'global.anthropic.claude-opus-4-8[1m]',
+ ],
+ opusMap: {
+ 'global.anthropic.claude-opus-4-8': 'global.anthropic.claude-opus-5',
+ 'global.anthropic.claude-opus-4-8[1m]': 'global.anthropic.claude-opus-5[1m]',
+ },
+};
+
+// The four seeded provider ids and which spec each follows. The bedrock TUI/CLI
+// pair and the bare TUI/CLI pair each ship identical model lists.
+const TARGETS = {
+ 'claude-code': BARE_SPEC,
+ 'claude-code-tui': BARE_SPEC,
+ 'claude-code-bedrock': BEDROCK_SPEC,
+ 'claude-code-tui-bedrock': BEDROCK_SPEC,
+};
+
+// The post-bump `models` array is fully derived from the prior seeded list plus
+// the id map, so the two can't drift apart in this file.
+const newModelsFor = (spec) => spec.oldModels.map((m) => spec.opusMap[m] ?? m);
+
+// Order-sensitive equality. Reordering the seeded list is treated as
+// customization (skipped) — mirrors migration 058/153's "left alone" promise.
+const sameArray = (a, b) => {
+ if (!Array.isArray(a) || !Array.isArray(b) || a.length !== b.length) return false;
+ return a.every((v, i) => v === b[i]);
+};
+
+// Swap any pointer that still references a retired opus id to its mapped
+// replacement. Pointers at still-current models (haiku, sonnet) are untouched.
+// Mutates in place; returns true if any pointer changed.
+const swapOpusPointers = (provider, opusMap) => {
+ let changed = false;
+ for (const key of POINTER_KEYS) {
+ const mapped = opusMap[provider[key]];
+ if (mapped) {
+ provider[key] = mapped;
+ changed = true;
+ }
+ }
+ return changed;
+};
+
+export default {
+ async up({ rootDir }) {
+ const providersPath = join(rootDir, PROVIDERS_REL_PATH);
+ const raw = await readFile(providersPath, 'utf-8').catch((err) => {
+ if (err.code === 'ENOENT') return null;
+ throw err;
+ });
+ if (raw == null) {
+ console.log(`📄 ${PROVIDERS_REL_PATH} not present — skipping (fresh install seeds from data.reference with the new defaults)`);
+ return;
+ }
+
+ let config;
+ try {
+ config = JSON.parse(raw);
+ } catch (err) {
+ console.log(`⚠️ ${PROVIDERS_REL_PATH}: invalid JSON, skipping (${err.message})`);
+ return;
+ }
+
+ const providers = config?.providers;
+ if (!providers || typeof providers !== 'object') {
+ console.log(`⚠️ ${PROVIDERS_REL_PATH}: no providers map — skipping`);
+ return;
+ }
+
+ const touched = [];
+ const alreadyCurrent = [];
+ const customized = [];
+
+ for (const [id, spec] of Object.entries(TARGETS)) {
+ const provider = providers[id];
+ if (!provider) continue;
+
+ const newModels = newModelsFor(spec);
+
+ if (sameArray(provider.models, spec.oldModels)) {
+ // Legacy opus-4-8 list → rewrite models + swap opus pointers.
+ provider.models = newModels;
+ swapOpusPointers(provider, spec.opusMap);
+ touched.push({ id, defaultModel: provider.defaultModel });
+ continue;
+ }
+
+ if (sameArray(provider.models, newModels)) {
+ // Models already current — only act if a tier pointer is still
+ // orphaned at a now-absent opus-4-8 id.
+ if (swapOpusPointers(provider, spec.opusMap)) {
+ touched.push({ id, defaultModel: provider.defaultModel });
+ } else {
+ alreadyCurrent.push(id);
+ }
+ continue;
+ }
+
+ customized.push(id);
+ }
+
+ if (touched.length === 0) {
+ const notes = [];
+ if (alreadyCurrent.length > 0) notes.push(`already current: ${alreadyCurrent.join(', ')}`);
+ if (customized.length > 0) notes.push(`customized: ${customized.join(', ')}`);
+ console.log(`✅ ${PROVIDERS_REL_PATH}: no Claude CLI/TUI changes needed${notes.length ? ` (${notes.join('; ')})` : ''}`);
+ return;
+ }
+
+ await writeFile(providersPath, `${JSON.stringify(config, null, 2)}\n`);
+ const summary = touched.map((t) => `${t.id} (default: ${t.defaultModel})`).join(', ');
+ console.log(`📝 ${PROVIDERS_REL_PATH}: updated ${summary} → opus tier claude-opus-5`);
+ },
+};
diff --git a/scripts/migrations/206-claude-default-opus-5.test.js b/scripts/migrations/206-claude-default-opus-5.test.js
new file mode 100644
index 0000000000..10e0b2c502
--- /dev/null
+++ b/scripts/migrations/206-claude-default-opus-5.test.js
@@ -0,0 +1,229 @@
+/**
+ * Test for migration 206 — bump the Claude CLI/TUI (+ Bedrock) provider opus
+ * tier from `claude-opus-4-8` to `claude-opus-5`, mapping the Bedrock `[1m]`
+ * long-context variant like-for-like. Picked up by
+ * server/vitest.config.js's `../scripts/**\/*.test.js` glob.
+ */
+import { describe, it, expect, beforeEach, afterEach } from 'vitest';
+import { mkdtempSync, rmSync, writeFileSync, readFileSync, mkdirSync, existsSync } from 'fs';
+import { tmpdir } from 'os';
+import { join } from 'path';
+
+import migration from './206-claude-default-opus-5.js';
+
+const writeJson = (path, value) => writeFileSync(path, JSON.stringify(value, null, 2) + '\n');
+const readJson = (path) => JSON.parse(readFileSync(path, 'utf-8'));
+
+const OLD_MODELS = ['claude-haiku-4-5', 'claude-sonnet-5', 'claude-opus-4-8'];
+const NEW_MODELS = ['claude-haiku-4-5', 'claude-sonnet-5', 'claude-opus-5'];
+
+const BEDROCK_OLD = [
+ 'us.anthropic.claude-haiku-4-5',
+ 'us.anthropic.claude-sonnet-5',
+ 'global.anthropic.claude-opus-4-8',
+ 'global.anthropic.claude-opus-4-8[1m]',
+];
+const BEDROCK_NEW = [
+ 'us.anthropic.claude-haiku-4-5',
+ 'us.anthropic.claude-sonnet-5',
+ 'global.anthropic.claude-opus-5',
+ 'global.anthropic.claude-opus-5[1m]',
+];
+
+const opus48Trio = (overrides = {}) => ({
+ id: 'claude-code',
+ models: [...OLD_MODELS],
+ defaultModel: 'claude-opus-4-8',
+ lightModel: 'claude-haiku-4-5',
+ mediumModel: 'claude-sonnet-5',
+ heavyModel: 'claude-opus-4-8',
+ ...overrides,
+});
+
+const bedrockOpus48 = (overrides = {}) => ({
+ id: 'claude-code-bedrock',
+ models: [...BEDROCK_OLD],
+ defaultModel: 'global.anthropic.claude-opus-4-8[1m]',
+ lightModel: 'us.anthropic.claude-haiku-4-5',
+ mediumModel: 'us.anthropic.claude-sonnet-5',
+ heavyModel: 'global.anthropic.claude-opus-4-8[1m]',
+ ...overrides,
+});
+
+describe('migration 206 — Claude CLI/TUI default opus tier → opus-5', () => {
+ let rootDir;
+ let providersPath;
+
+ beforeEach(() => {
+ rootDir = mkdtempSync(join(tmpdir(), 'migration-206-'));
+ mkdirSync(join(rootDir, 'data'), { recursive: true });
+ providersPath = join(rootDir, 'data/providers.json');
+ });
+
+ afterEach(() => {
+ rmSync(rootDir, { recursive: true, force: true });
+ });
+
+ it('upgrades the opus-4-8 trio to the opus-5 trio (models + default/heavy pointers)', async () => {
+ writeJson(providersPath, { providers: { 'claude-code': opus48Trio() } });
+
+ await migration.up({ rootDir });
+
+ const after = readJson(providersPath).providers['claude-code'];
+ expect(after.models).toEqual(NEW_MODELS);
+ expect(after.defaultModel).toBe('claude-opus-5');
+ expect(after.heavyModel).toBe('claude-opus-5');
+ expect(after.lightModel).toBe('claude-haiku-4-5'); // untouched
+ expect(after.mediumModel).toBe('claude-sonnet-5'); // untouched
+ });
+
+ it('preserves a still-current pin (sonnet default) while bumping the opus tier', async () => {
+ writeJson(providersPath, {
+ providers: { 'claude-code': opus48Trio({ defaultModel: 'claude-sonnet-5' }) },
+ });
+
+ await migration.up({ rootDir });
+
+ const after = readJson(providersPath).providers['claude-code'];
+ expect(after.models).toEqual(NEW_MODELS);
+ expect(after.defaultModel).toBe('claude-sonnet-5');
+ expect(after.heavyModel).toBe('claude-opus-5');
+ });
+
+ it('repairs an orphan opus-4-8 pointer when models are already the new trio', async () => {
+ writeJson(providersPath, {
+ providers: {
+ 'claude-code': {
+ id: 'claude-code',
+ models: [...NEW_MODELS],
+ defaultModel: 'claude-opus-4-8', // orphan: not in NEW_MODELS
+ lightModel: 'claude-haiku-4-5',
+ mediumModel: 'claude-sonnet-5',
+ heavyModel: 'claude-opus-5',
+ },
+ },
+ });
+
+ await migration.up({ rootDir });
+
+ const after = readJson(providersPath).providers['claude-code'];
+ expect(after.defaultModel).toBe('claude-opus-5');
+ expect(after.models).toContain(after.defaultModel);
+ });
+
+ it('is a no-op when models AND pointers are already opus-5', async () => {
+ const current = {
+ id: 'claude-code',
+ models: [...NEW_MODELS],
+ defaultModel: 'claude-opus-5',
+ lightModel: 'claude-haiku-4-5',
+ mediumModel: 'claude-sonnet-5',
+ heavyModel: 'claude-opus-5',
+ };
+ writeJson(providersPath, { providers: { 'claude-code': current } });
+ const beforeBytes = readFileSync(providersPath, 'utf-8');
+
+ await migration.up({ rootDir });
+
+ expect(readFileSync(providersPath, 'utf-8')).toBe(beforeBytes);
+ });
+
+ it('skips a customized models list (user dropped haiku, etc.)', async () => {
+ const customized = {
+ id: 'claude-code',
+ models: ['claude-sonnet-5', 'claude-opus-4-8'],
+ defaultModel: 'claude-opus-4-8',
+ };
+ writeJson(providersPath, { providers: { 'claude-code': customized } });
+ const beforeBytes = readFileSync(providersPath, 'utf-8');
+
+ await migration.up({ rootDir });
+
+ expect(readFileSync(providersPath, 'utf-8')).toBe(beforeBytes);
+ });
+
+ it('treats a reordered trio as customization (skip)', async () => {
+ const reordered = {
+ id: 'claude-code',
+ models: ['claude-opus-4-8', 'claude-haiku-4-5', 'claude-sonnet-5'],
+ defaultModel: 'claude-opus-4-8',
+ };
+ writeJson(providersPath, { providers: { 'claude-code': reordered } });
+ const beforeBytes = readFileSync(providersPath, 'utf-8');
+
+ await migration.up({ rootDir });
+
+ expect(readFileSync(providersPath, 'utf-8')).toBe(beforeBytes);
+ });
+
+ it('processes claude-code and claude-code-tui together, leaving others alone', async () => {
+ writeJson(providersPath, {
+ providers: {
+ 'claude-code': opus48Trio(),
+ 'claude-code-tui': opus48Trio({ id: 'claude-code-tui' }),
+ 'codex': { id: 'codex', models: ['codex-configured-default'] },
+ },
+ });
+
+ await migration.up({ rootDir });
+
+ const out = readJson(providersPath).providers;
+ expect(out['claude-code'].defaultModel).toBe('claude-opus-5');
+ expect(out['claude-code-tui'].defaultModel).toBe('claude-opus-5');
+ expect(out['codex'].models).toEqual(['codex-configured-default']);
+ });
+
+ it('upgrades the Bedrock providers, preserving the [1m] long-context pin', async () => {
+ writeJson(providersPath, {
+ providers: {
+ 'claude-code-bedrock': bedrockOpus48(),
+ 'claude-code-tui-bedrock': bedrockOpus48({ id: 'claude-code-tui-bedrock' }),
+ },
+ });
+
+ await migration.up({ rootDir });
+
+ const out = readJson(providersPath).providers;
+ for (const id of ['claude-code-bedrock', 'claude-code-tui-bedrock']) {
+ expect(out[id].models).toEqual(BEDROCK_NEW);
+ expect(out[id].defaultModel).toBe('global.anthropic.claude-opus-5[1m]');
+ expect(out[id].heavyModel).toBe('global.anthropic.claude-opus-5[1m]');
+ // Other Bedrock tiers untouched.
+ expect(out[id].lightModel).toBe('us.anthropic.claude-haiku-4-5');
+ expect(out[id].mediumModel).toBe('us.anthropic.claude-sonnet-5');
+ }
+ });
+
+ it('maps a plain (non-[1m]) Bedrock opus pin to the plain new id, not the [1m] one', async () => {
+ writeJson(providersPath, {
+ providers: {
+ 'claude-code-bedrock': bedrockOpus48({
+ defaultModel: 'global.anthropic.claude-opus-4-8',
+ heavyModel: 'global.anthropic.claude-opus-4-8',
+ }),
+ },
+ });
+
+ await migration.up({ rootDir });
+
+ const after = readJson(providersPath).providers['claude-code-bedrock'];
+ expect(after.defaultModel).toBe('global.anthropic.claude-opus-5');
+ expect(after.heavyModel).toBe('global.anthropic.claude-opus-5');
+ expect(after.models).toContain(after.defaultModel);
+ });
+
+ it('is a no-op when data/providers.json does not exist (fresh install)', async () => {
+ await migration.up({ rootDir });
+
+ expect(existsSync(providersPath)).toBe(false);
+ });
+
+ it('does not modify the file on invalid JSON (logs a warning and skips)', async () => {
+ writeFileSync(providersPath, '{ not valid json');
+ const before = readFileSync(providersPath, 'utf-8');
+
+ await migration.up({ rootDir });
+
+ expect(readFileSync(providersPath, 'utf-8')).toBe(before);
+ });
+});
diff --git a/server/lib/aiToolkit/defaults/providers.sample.json b/server/lib/aiToolkit/defaults/providers.sample.json
index 4c23ce303c..169f015c0f 100644
--- a/server/lib/aiToolkit/defaults/providers.sample.json
+++ b/server/lib/aiToolkit/defaults/providers.sample.json
@@ -7,11 +7,11 @@
"type": "cli",
"command": "claude",
"args": ["--print"],
- "models": ["claude-haiku-4-5", "claude-sonnet-5", "claude-opus-4-8"],
- "defaultModel": "claude-opus-4-8",
+ "models": ["claude-haiku-4-5", "claude-sonnet-5", "claude-opus-5"],
+ "defaultModel": "claude-opus-5",
"lightModel": "claude-haiku-4-5",
"mediumModel": "claude-sonnet-5",
- "heavyModel": "claude-opus-4-8",
+ "heavyModel": "claude-opus-5",
"timeout": 300000,
"enabled": true,
"envVars": {},
@@ -24,11 +24,11 @@
"type": "cli",
"command": "claude",
"args": ["--print"],
- "models": ["us.anthropic.claude-haiku-4-5", "us.anthropic.claude-sonnet-5", "global.anthropic.claude-opus-4-8", "global.anthropic.claude-opus-4-8[1m]"],
- "defaultModel": "global.anthropic.claude-opus-4-8[1m]",
+ "models": ["us.anthropic.claude-haiku-4-5", "us.anthropic.claude-sonnet-5", "global.anthropic.claude-opus-5", "global.anthropic.claude-opus-5[1m]"],
+ "defaultModel": "global.anthropic.claude-opus-5[1m]",
"lightModel": "us.anthropic.claude-haiku-4-5",
"mediumModel": "us.anthropic.claude-sonnet-5",
- "heavyModel": "global.anthropic.claude-opus-4-8[1m]",
+ "heavyModel": "global.anthropic.claude-opus-5[1m]",
"timeout": 300000,
"enabled": false,
"envVars": {
@@ -154,11 +154,11 @@
"type": "tui",
"command": "claude",
"args": ["--dangerously-skip-permissions"],
- "models": ["claude-haiku-4-5", "claude-sonnet-5", "claude-opus-4-8"],
- "defaultModel": "claude-opus-4-8",
+ "models": ["claude-haiku-4-5", "claude-sonnet-5", "claude-opus-5"],
+ "defaultModel": "claude-opus-5",
"lightModel": "claude-haiku-4-5",
"mediumModel": "claude-sonnet-5",
- "heavyModel": "claude-opus-4-8",
+ "heavyModel": "claude-opus-5",
"timeout": 600000,
"enabled": true,
"envVars": {},
@@ -172,11 +172,11 @@
"type": "tui",
"command": "claude",
"args": ["--dangerously-skip-permissions"],
- "models": ["us.anthropic.claude-haiku-4-5", "us.anthropic.claude-sonnet-5", "global.anthropic.claude-opus-4-8", "global.anthropic.claude-opus-4-8[1m]"],
- "defaultModel": "global.anthropic.claude-opus-4-8[1m]",
+ "models": ["us.anthropic.claude-haiku-4-5", "us.anthropic.claude-sonnet-5", "global.anthropic.claude-opus-5", "global.anthropic.claude-opus-5[1m]"],
+ "defaultModel": "global.anthropic.claude-opus-5[1m]",
"lightModel": "us.anthropic.claude-haiku-4-5",
"mediumModel": "us.anthropic.claude-sonnet-5",
- "heavyModel": "global.anthropic.claude-opus-4-8[1m]",
+ "heavyModel": "global.anthropic.claude-opus-5[1m]",
"timeout": 600000,
"enabled": false,
"envVars": { "CLAUDE_CODE_USE_BEDROCK": "1", "AWS_BEARER_TOKEN_BEDROCK": "" },
diff --git a/server/lib/aiToolkit/defaults/providersSeedParity.test.js b/server/lib/aiToolkit/defaults/providersSeedParity.test.js
new file mode 100644
index 0000000000..86c73f115c
--- /dev/null
+++ b/server/lib/aiToolkit/defaults/providersSeedParity.test.js
@@ -0,0 +1,62 @@
+/**
+ * Parity test for the two shipped provider seeds:
+ * data.reference/providers.json (PortOS's own install seed)
+ * server/lib/aiToolkit/defaults/providers.sample.json (the toolkit's fallback seed)
+ *
+ * Both files describe the same 21 providers, and `loadProviders()` falls
+ * through to the toolkit sample when the install seed is absent — so a model
+ * bump that updates one and not the other silently gives some fresh installs a
+ * stale tier. That failure then compounds: the provider-bump migrations
+ * (058/153/206) only rewrite a `models` list that matches the *prior seeded*
+ * shape EXACTLY, so a stale-sample install is classified "customized" and
+ * deliberately left alone — the very migration meant to repair it refuses to.
+ *
+ * Only the model-selection fields are compared. Everything else (timeouts,
+ * `enabled`, env vars) legitimately differs: the toolkit sample is a generic
+ * default, PortOS's seed is tuned for this install.
+ *
+ * This reads both files as JSON — it does NOT import out of the vendored
+ * aiToolkit directory into PortOS (see server/lib/aiToolkit/CLAUDE.md), so the
+ * self-contained rule is preserved. If an upstream toolkit sync ever diverges
+ * the sample, this test makes that visible instead of silent.
+ */
+
+import { describe, it, expect } from 'vitest';
+import { readFileSync } from 'fs';
+import { resolve, dirname } from 'path';
+import { fileURLToPath } from 'url';
+
+const __dirname = dirname(fileURLToPath(import.meta.url));
+
+const REFERENCE_PATH = resolve(__dirname, '../../../../data.reference/providers.json');
+const SAMPLE_PATH = resolve(__dirname, 'providers.sample.json');
+
+const MODEL_FIELDS = ['models', 'defaultModel', 'lightModel', 'mediumModel', 'heavyModel'];
+
+// `lmstudio` is the one documented divergence: PortOS's seed names a concrete
+// local model it ships guidance for, while the toolkit sample ships an empty
+// list because a generic install has no way to know what the user has pulled.
+const EXEMPT_IDS = new Set(['lmstudio']);
+
+const readJson = (path) => JSON.parse(readFileSync(path, 'utf8'));
+
+describe('provider seed parity — data.reference ↔ aiToolkit sample', () => {
+ const reference = readJson(REFERENCE_PATH);
+ const sample = readJson(SAMPLE_PATH);
+
+ it('both seeds describe the same provider ids', () => {
+ expect(Object.keys(sample.providers).sort()).toEqual(Object.keys(reference.providers).sort());
+ });
+
+ for (const id of Object.keys(reference.providers)) {
+ if (EXEMPT_IDS.has(id)) continue;
+ it(`${id} declares the same models and tier pointers in both seeds`, () => {
+ for (const field of MODEL_FIELDS) {
+ expect(
+ sample.providers[id]?.[field],
+ `${id}.${field} diverged — update data.reference/providers.json and providers.sample.json together`,
+ ).toEqual(reference.providers[id]?.[field]);
+ }
+ });
+ }
+});
diff --git a/server/lib/aiToolkit/errorDetection.js b/server/lib/aiToolkit/errorDetection.js
index bcdc41f125..80c7cd6435 100644
--- a/server/lib/aiToolkit/errorDetection.js
+++ b/server/lib/aiToolkit/errorDetection.js
@@ -69,8 +69,8 @@ const ERROR_PATTERNS = [
{
// "model identifier is invalid" is Bedrock's wording when the runner passes
// a model id the backend doesn't recognize (e.g. a bare Anthropic id like
- // `claude-opus-4-8` to a Bedrock-backed Claude Code, which wants
- // `global.anthropic.claude-opus-4-8`). Categorize it alongside the
+ // `claude-opus-5` to a Bedrock-backed Claude Code, which wants
+ // `global.anthropic.claude-opus-5`). Categorize it alongside the
// not-found/invalid-model phrasings so the cooldown + fallback path treats
// it as the config problem it is.
pattern: /model.*(not found|does not exist|unavailable)|invalid model|model identifier is invalid/i,
diff --git a/server/lib/aiToolkit/providers.js b/server/lib/aiToolkit/providers.js
index 775709ddf2..31cbd498a5 100644
--- a/server/lib/aiToolkit/providers.js
+++ b/server/lib/aiToolkit/providers.js
@@ -799,6 +799,7 @@ export function createProviderService(config = {}) {
async _fetchAnthropicModels(_provider) {
return [
+ 'claude-opus-5',
'claude-opus-4-8',
'claude-opus-4-7',
'claude-sonnet-5',
diff --git a/server/lib/cliProviderArgs.js b/server/lib/cliProviderArgs.js
index e4d6d4eefd..2c495fa702 100644
--- a/server/lib/cliProviderArgs.js
+++ b/server/lib/cliProviderArgs.js
@@ -123,7 +123,7 @@ export function buildCliArgs(provider) {
// cli — respect user-baked model flags.
const args = [...baseArgs, '-p', '-'];
if (effectiveDefaultModel && !hasModelFlag(baseArgs)) {
- // On a Bedrock box a bare `claude-opus-4-8` is rejected — map it to the
+ // On a Bedrock box a bare `claude-opus-5` is rejected — map it to the
// region-prefixed Bedrock id just-in-time (no-op off Bedrock / for
// already-prefixed ids). provider.envVars carries CLAUDE_CODE_USE_BEDROCK
// for the bedrock provider variants; process.env covers a Bedrock host.
diff --git a/server/lib/modelPricing.js b/server/lib/modelPricing.js
index f93f7a2198..8752472692 100644
--- a/server/lib/modelPricing.js
+++ b/server/lib/modelPricing.js
@@ -28,6 +28,7 @@ const EXACT_RATES = {
// Anthropic
'claude-fable-5': [10.0, 50.0],
'claude-mythos-5': [10.0, 50.0],
+ 'claude-opus-5': [5.0, 25.0],
'claude-opus-4-8': [5.0, 25.0],
'claude-opus-4-7': [5.0, 25.0],
'claude-opus-4-6': [5.0, 25.0],
@@ -71,7 +72,7 @@ const EXACT_RATES = {
// Exact keys sorted longest-first for the substring pass in
// resolveModelRates — a suffixed/prefixed variant of a known id
-// (`gpt-5.6-terra-2026-06-01`, `global.anthropic.claude-opus-4-8`) resolves to
+// (`gpt-5.6-terra-2026-06-01`, `global.anthropic.claude-opus-5`) resolves to
// its base rates without needing a hand-written regex per model, and
// longest-first makes `gpt-5.5-pro` win over `gpt-5.5`. (Keys are all
// lowercase, so matching against a lowercased id needs no re-mapping.)
@@ -85,7 +86,7 @@ const EXACT_KEYS_BY_LENGTH = Object.keys(EXACT_RATES).sort((a, b) => b.length -
*/
const FAMILY_RULES = [
{ test: /fable|mythos/i, rateModel: 'claude-fable-5' },
- { test: /opus/i, rateModel: 'claude-opus-4-8' },
+ { test: /opus/i, rateModel: 'claude-opus-5' },
{ test: /sonnet[-.]?5/i, rateModel: 'claude-sonnet-5' },
{ test: /sonnet/i, rateModel: 'claude-sonnet-4-5' },
{ test: /haiku/i, rateModel: 'claude-haiku-4-5' },
diff --git a/server/lib/modelPricing.test.js b/server/lib/modelPricing.test.js
index 096c4b312c..5cbd253012 100644
--- a/server/lib/modelPricing.test.js
+++ b/server/lib/modelPricing.test.js
@@ -5,10 +5,12 @@ describe('resolveModelRates', () => {
it('matches exact model ids', () => {
const r = resolveModelRates('claude-code', 'claude-opus-4-8');
expect(r).toMatchObject({ rateModel: 'claude-opus-4-8', inputPer1M: 5, outputPer1M: 25, matched: 'exact' });
+ const r5 = resolveModelRates('claude-code', 'claude-opus-5');
+ expect(r5).toMatchObject({ rateModel: 'claude-opus-5', inputPer1M: 5, outputPer1M: 25, matched: 'exact' });
});
it('resolves CLI shorthand model names via family rules', () => {
- expect(resolveModelRates('claude-code', 'opus')).toMatchObject({ rateModel: 'claude-opus-4-8', matched: 'family' });
+ expect(resolveModelRates('claude-code', 'opus')).toMatchObject({ rateModel: 'claude-opus-5', matched: 'family' });
expect(resolveModelRates('claude-code', 'sonnet')).toMatchObject({ rateModel: 'claude-sonnet-4-5', matched: 'family' });
expect(resolveModelRates('claude-code', 'haiku')).toMatchObject({ rateModel: 'claude-haiku-4-5', matched: 'family' });
});
@@ -21,6 +23,8 @@ describe('resolveModelRates', () => {
it('resolves Bedrock-prefixed ids through family rules', () => {
const r = resolveModelRates('claude-code-bedrock', 'global.anthropic.claude-opus-4-8');
expect(r).toMatchObject({ rateModel: 'claude-opus-4-8', matched: 'family' });
+ const r5 = resolveModelRates('claude-code-bedrock', 'global.anthropic.claude-opus-5');
+ expect(r5).toMatchObject({ rateModel: 'claude-opus-5', matched: 'family' });
});
it('resolves configured-default sentinels to their provider family', () => {
diff --git a/server/lib/providerModels.js b/server/lib/providerModels.js
index ba77ba7e1f..cf311c8e90 100644
--- a/server/lib/providerModels.js
+++ b/server/lib/providerModels.js
@@ -262,9 +262,9 @@ export function prefixOpencodeModel(provider, model) {
/**
* Claude Code on AWS Bedrock wants region-prefixed model ids
- * (`global.anthropic.claude-opus-4-8`, `us.anthropic.claude-opus-4-1-...-v1:0`).
+ * (`global.anthropic.claude-opus-5`, `us.anthropic.claude-opus-4-1-...-v1:0`).
* When `CLAUDE_CODE_USE_BEDROCK` is set on the box, passing a bare
- * `claude --model claude-opus-4-8` is rejected ("provided model identifier is
+ * `claude --model claude-opus-5` is rejected ("provided model identifier is
* invalid") — which is exactly how a bare-id `claude-code` provider config
* breaks autopilot/pipeline runs on a Bedrock host. The helpers below map a
* bare id to its Bedrock form just-in-time at CLI-argv build time; the stored
diff --git a/server/lib/stageRunner.js b/server/lib/stageRunner.js
index 7617d96f8a..d4f37b7030 100644
--- a/server/lib/stageRunner.js
+++ b/server/lib/stageRunner.js
@@ -130,6 +130,7 @@ const KNOWN_MODEL_CONTEXT_WINDOWS = Object.freeze([
[/gpt[-_.:/]?5\.4(?![-_.:/]?(?:mini|nano))(?:[-_.:/]|\b)/i, CODEX_CONTEXT_WINDOW],
[/claude[-_.:/]?fable[-_.:/]?5(?:[-_.:/]|\b)/i, 1_000_000],
[/claude[-_.:/]?mythos[-_.:/]?5(?:[-_.:/]|\b)/i, 1_000_000],
+ [/claude[-_.:/]?opus[-_.:/]?5(?:[-_.:/]|\b)/i, 1_000_000],
[/claude[-_.:/]?opus[-_.:/]?4[-_.:/]?8/i, 1_000_000],
[/claude[-_.:/]?sonnet[-_.:/]?5(?:[-_.:/]|\b)/i, 1_000_000],
[/claude[-_.:/]?sonnet[-_.:/]?4[-_.:/]?6(?:[-_.:/]|\b)/i, 1_000_000],
diff --git a/server/lib/stageRunner.mirror.test.js b/server/lib/stageRunner.mirror.test.js
new file mode 100644
index 0000000000..e5f40305a4
--- /dev/null
+++ b/server/lib/stageRunner.mirror.test.js
@@ -0,0 +1,55 @@
+/**
+ * Mirror parity test for the `KNOWN_MODEL_CONTEXT_WINDOWS` table, which lives
+ * in both server/lib/stageRunner.js and client/src/utils/providers.js (the
+ * client can't import server modules, so the table is duplicated behind a
+ * "Keep in sync" comment on each side).
+ *
+ * Until now the mirror was pinned by that comment alone: each side had its own
+ * hardcoded expectations (`stageRunner.test.js` / `providers.test.js`), so a
+ * model bump that added a row to only one copy left BOTH suites green. The two
+ * ends would then disagree about whether a given manuscript fits in one call —
+ * the server chunking against the real window while the client's "context used"
+ * meter falls through to the conservative DEFAULT_LARGE_CONTEXT_WINDOW, or vice
+ * versa. Silent, and ~8x off.
+ *
+ * Only the table is mirrored: `knownModelContextWindow` is legitimately a
+ * `function` server-side and an arrow const client-side, so it is not compared.
+ * Comparison strips comments, so per-side commentary may diverge — logic can't.
+ */
+
+import { describe, it, expect } from 'vitest';
+import { readFileSync } from 'fs';
+import { resolve, dirname } from 'path';
+import { fileURLToPath } from 'url';
+import { compareDeclaration } from './mirrorParity.js';
+
+const __dirname = dirname(fileURLToPath(import.meta.url));
+
+const SERVER_PATH = resolve(__dirname, 'stageRunner.js');
+const CLIENT_PATH = resolve(__dirname, '../../client/src/utils/providers.js');
+
+const MIRRORED_NAMES = ['KNOWN_MODEL_CONTEXT_WINDOWS'];
+
+describe('stageRunner↔client providers context-window mirror parity', () => {
+ const serverSrc = readFileSync(SERVER_PATH, 'utf8');
+ const clientSrc = readFileSync(CLIENT_PATH, 'utf8');
+
+ it('both files are non-empty', () => {
+ expect(serverSrc.length).toBeGreaterThan(100);
+ expect(clientSrc.length).toBeGreaterThan(100);
+ });
+
+ for (const name of MIRRORED_NAMES) {
+ it(`${name} is present and identical on both sides (code only)`, () => {
+ const { serverDecl, clientDecl, serverNorm, clientNorm } =
+ compareDeclaration(serverSrc, clientSrc, name);
+
+ expect(serverDecl, `server/lib/stageRunner.js is missing: ${name}`).not.toBeNull();
+ expect(clientDecl, `client/src/utils/providers.js is missing: ${name}`).not.toBeNull();
+ expect(
+ clientNorm,
+ `"${name}" diverged — the server copy is authoritative; port the change verbatim`,
+ ).toBe(serverNorm);
+ });
+ }
+});
diff --git a/server/lib/stageRunner.test.js b/server/lib/stageRunner.test.js
index c2f95bd0a1..ef54ae4c52 100644
--- a/server/lib/stageRunner.test.js
+++ b/server/lib/stageRunner.test.js
@@ -95,6 +95,8 @@ describe('stageRunner — context windows', () => {
expect(knownModelContextWindow('gpt-5.4')).toBe(CODEX_CONTEXT_WINDOW);
expect(knownModelContextWindow('gpt-5.4-mini')).toBe(400_000);
expect(knownModelContextWindow('gpt-5.4-nano')).toBeNull();
+ expect(knownModelContextWindow('claude-opus-5')).toBe(1_000_000);
+ expect(knownModelContextWindow('global.anthropic.claude-opus-5')).toBe(1_000_000);
expect(knownModelContextWindow('claude-opus-4-8')).toBe(1_000_000);
expect(knownModelContextWindow('claude-sonnet-5')).toBe(1_000_000);
expect(knownModelContextWindow('claude-sonnet-4-6')).toBe(1_000_000);
diff --git a/server/routes/scaffoldPortOS.js b/server/routes/scaffoldPortOS.js
index e9b6f8d87c..11a4ec9b72 100644
--- a/server/routes/scaffoldPortOS.js
+++ b/server/routes/scaffoldPortOS.js
@@ -347,11 +347,11 @@ export default defineConfig({
type: 'cli',
command: 'claude',
args: ['--print'],
- models: ['claude-haiku-4-5', 'claude-sonnet-5', 'claude-opus-4-8'],
- defaultModel: 'claude-opus-4-8',
+ models: ['claude-haiku-4-5', 'claude-sonnet-5', 'claude-opus-5'],
+ defaultModel: 'claude-opus-5',
lightModel: 'claude-haiku-4-5',
mediumModel: 'claude-sonnet-5',
- heavyModel: 'claude-opus-4-8',
+ heavyModel: 'claude-opus-5',
timeout: 300000,
enabled: true,
envVars: {}
diff --git a/server/services/localLlm.js b/server/services/localLlm.js
index 1dc3f90bd8..32745db877 100644
--- a/server/services/localLlm.js
+++ b/server/services/localLlm.js
@@ -788,7 +788,7 @@ export async function listVisionModels() {
/**
* Vision-capable CLI providers (codex / claude-code), expanded to one entry per
* configured model so the caption picker can offer e.g. "codex / gpt-5" or
- * "claude-code / claude-opus-4-8". A disabled provider is skipped. Each entry
+ * "claude-code / claude-opus-5". A disabled provider is skipped. Each entry
* mirrors the local-backend shape with `backend: 'cli'`. Best-effort: a load
* failure yields no CLI entries rather than breaking the whole picker.
*/