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

feat(claude-default-opus-4-8): default Claude CLI/TUI providers to claude-opus-4-8

[._.]/ Adam Eivyc34dc0ece4e8
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index 8ab4ee0d7e..5ef6490c9a 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -2,6 +2,8 @@
## Changed
+- **[claude-default-opus-4-8] Default Claude CLI/TUI providers now use `claude-opus-4-8`.** The seeded `claude-code` and `claude-code-tui` providers ship the new opus tier (`claude-haiku-4-5` / `claude-sonnet-4-6` / `claude-opus-4-8`) with `claude-opus-4-8` as the default and heavy model, and the Anthropic model-refresh dropdown lists it first. Migration 058 bumps existing installs from the opus-4-7 trio to the opus-4-8 trio — rewriting the models list and swapping any tier pointer still on `claude-opus-4-7`, while leaving customized model lists and still-current pins (sonnet-4-6, haiku-4-5) untouched. Bedrock providers (separate model ids) are not affected.
+
- **[comic-structure-editorial-review] "Finish the draft" editorial review now flags malformed comic-script pages.** Comic scripts can accumulate pages where all scene content — action, dialogue, transitions — is in the page-level description instead of panel definitions; those pages can't be rendered by the image generator because no discrete panels exist. The review pass now detects these as a new `comic-structure` category finding (always `high` severity) and generates a full panel-by-panel rewrite as the suggestion, so accepting the fix restructures the page in place. A legitimate page description is 1–3 lines of layout intent; anything longer that reads as story content is flagged. Migration 057 updates the `pipeline-manuscript-completeness` prompt on existing installs (customized prompts are skipped with a warning).
- **[catalog-type-table-vs-check] Adding a new catalog ingredient type no longer needs a database migration.** The `catalog_ingredients.type` column previously carried a hardcoded `CHECK (type IN (…six types…))` duplicated in both the fresh-install SQL and the runtime schema-upgrade path, so introducing a seventh type meant a two-file constraint migration. The CHECK is dropped (and the column widened to `VARCHAR(32)`); valid types are now enforced purely at the app layer by the shared type registry (`catalogTypes.js`) and its Zod enum — the same gate that was already validating every create/update. Existing installs drop the constraint idempotently on the next restart. No behavior change for the current six types and no cross-peer sync version bump (the wire payloads are identical until a new type is actually introduced); this clears the precondition for user-defined ingredient types.
diff --git a/data.reference/providers.json b/data.reference/providers.json
index fc15cf4d4a..8a39a6b7a1 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-4-6", "claude-opus-4-7"],
- "defaultModel": "claude-opus-4-7",
+ "models": ["claude-haiku-4-5", "claude-sonnet-4-6", "claude-opus-4-8"],
+ "defaultModel": "claude-opus-4-8",
"lightModel": "claude-haiku-4-5",
"mediumModel": "claude-sonnet-4-6",
- "heavyModel": "claude-opus-4-7",
+ "heavyModel": "claude-opus-4-8",
"timeout": 900000,
"enabled": true,
"envVars": {}
@@ -87,11 +87,11 @@
"type": "tui",
"command": "claude",
"args": ["--dangerously-skip-permissions"],
- "models": ["claude-haiku-4-5", "claude-sonnet-4-6", "claude-opus-4-7"],
- "defaultModel": "claude-opus-4-7",
+ "models": ["claude-haiku-4-5", "claude-sonnet-4-6", "claude-opus-4-8"],
+ "defaultModel": "claude-opus-4-8",
"lightModel": "claude-haiku-4-5",
"mediumModel": "claude-sonnet-4-6",
- "heavyModel": "claude-opus-4-7",
+ "heavyModel": "claude-opus-4-8",
"timeout": 900000,
"enabled": true,
"envVars": {},
diff --git a/scripts/migrations/058-claude-default-opus-4-8.js b/scripts/migrations/058-claude-default-opus-4-8.js
new file mode 100644
index 0000000000..8f7e81b7e9
--- /dev/null
+++ b/scripts/migrations/058-claude-default-opus-4-8.js
@@ -0,0 +1,132 @@
+/**
+ * Bump the Claude CLI/TUI provider defaults from the opus-4-7 trio to the
+ * opus-4-8 trio.
+ *
+ * The prior seeded shape (from migration 032 / the data.reference + scaffold
+ * + aiToolkit defaults) was the undated trio:
+ * models: ['claude-haiku-4-5', 'claude-sonnet-4-6', 'claude-opus-4-7']
+ * defaultModel: 'claude-opus-4-7'
+ * heavyModel: 'claude-opus-4-7'
+ * light/medium: 'claude-haiku-4-5' / 'claude-sonnet-4-6'
+ *
+ * The new default swaps the opus tier to `claude-opus-4-8`. 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 032's policy:
+ * - Only rewrite when `models` matches the opus-4-7 trio EXACTLY
+ * (order-sensitive). A user who curated their own list is left alone.
+ * - When a rewrite happens, swap `claude-opus-4-7` → `claude-opus-4-8`
+ * wherever it appears (models array + any tier pointer). Tier pointers
+ * at still-current models (haiku-4-5, sonnet-4-6) are preserved.
+ * - Also handle the "already-new-models but stale opus-4-7 pointer" case:
+ * an install whose models already list opus-4-8 (fresh seed via 4-8
+ * data.reference) but still has a tier pointer left at the now-absent
+ * opus-4-7 gets that orphan pointer repaired to opus-4-8.
+ */
+
+import { readFile, writeFile } from 'fs/promises';
+import { join } from 'path';
+
+const PROVIDERS_REL_PATH = 'data/providers.json';
+
+const OLD_OPUS = 'claude-opus-4-7';
+const NEW_OPUS = 'claude-opus-4-8';
+
+const OLD_MODELS = ['claude-haiku-4-5', 'claude-sonnet-4-6', OLD_OPUS];
+const NEW_MODELS = ['claude-haiku-4-5', 'claude-sonnet-4-6', NEW_OPUS];
+
+const TARGET_IDS = ['claude-code', 'claude-code-tui'];
+const POINTER_KEYS = ['defaultModel', 'lightModel', 'mediumModel', 'heavyModel'];
+
+// Order-sensitive equality. Reordering the seeded list is treated as
+// customization (skipped) — mirrors migration 032'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 the retired opus-4-7 to opus-4-8.
+// Pointers at still-current models (haiku-4-5, sonnet-4-6) are untouched.
+// Mutates in place; returns true if any pointer changed.
+const swapOpusPointers = (provider) => {
+ let changed = false;
+ for (const key of POINTER_KEYS) {
+ if (provider[key] === OLD_OPUS) {
+ provider[key] = NEW_OPUS;
+ 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 of TARGET_IDS) {
+ const provider = providers[id];
+ if (!provider) continue;
+
+ if (sameArray(provider.models, OLD_MODELS)) {
+ // Legacy opus-4-7 trio → rewrite models + swap opus pointers.
+ provider.models = [...NEW_MODELS];
+ swapOpusPointers(provider);
+ touched.push({ id, defaultModel: provider.defaultModel });
+ continue;
+ }
+
+ if (sameArray(provider.models, NEW_MODELS)) {
+ // Models already current — only act if a tier pointer is still
+ // orphaned at the now-absent opus-4-7.
+ if (swapOpusPointers(provider)) {
+ 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} → models claude-haiku-4-5 / claude-sonnet-4-6 / ${NEW_OPUS}`);
+ },
+};
diff --git a/scripts/migrations/058-claude-default-opus-4-8.test.js b/scripts/migrations/058-claude-default-opus-4-8.test.js
new file mode 100644
index 0000000000..790a320613
--- /dev/null
+++ b/scripts/migrations/058-claude-default-opus-4-8.test.js
@@ -0,0 +1,180 @@
+/**
+ * Test for migration 058 — bump Claude CLI/TUI providers from the opus-4-7
+ * trio to the opus-4-8 trio. 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 './058-claude-default-opus-4-8.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-4-6', 'claude-opus-4-7'];
+const NEW_MODELS = ['claude-haiku-4-5', 'claude-sonnet-4-6', 'claude-opus-4-8'];
+
+const opus47Trio = (overrides = {}) => ({
+ id: 'claude-code',
+ models: [...OLD_MODELS],
+ defaultModel: 'claude-opus-4-7',
+ lightModel: 'claude-haiku-4-5',
+ mediumModel: 'claude-sonnet-4-6',
+ heavyModel: 'claude-opus-4-7',
+ ...overrides,
+});
+
+describe('migration 058 — Claude CLI/TUI default to opus-4-8', () => {
+ let rootDir;
+ let providersPath;
+
+ beforeEach(() => {
+ rootDir = mkdtempSync(join(tmpdir(), 'migration-058-'));
+ mkdirSync(join(rootDir, 'data'), { recursive: true });
+ providersPath = join(rootDir, 'data/providers.json');
+ });
+
+ afterEach(() => {
+ rmSync(rootDir, { recursive: true, force: true });
+ });
+
+ it('upgrades the opus-4-7 trio to the opus-4-8 trio (models + default + heavy)', async () => {
+ writeJson(providersPath, { providers: { 'claude-code': opus47Trio() } });
+
+ await migration.up({ rootDir });
+
+ const after = readJson(providersPath).providers['claude-code'];
+ expect(after.models).toEqual(NEW_MODELS);
+ expect(after.defaultModel).toBe('claude-opus-4-8');
+ expect(after.lightModel).toBe('claude-haiku-4-5');
+ expect(after.mediumModel).toBe('claude-sonnet-4-6');
+ expect(after.heavyModel).toBe('claude-opus-4-8');
+ });
+
+ it('preserves a still-current pin (sonnet-4-6 default) while bumping the opus tier', async () => {
+ writeJson(providersPath, {
+ providers: { 'claude-code': opus47Trio({ defaultModel: 'claude-sonnet-4-6' }) },
+ });
+
+ await migration.up({ rootDir });
+
+ const after = readJson(providersPath).providers['claude-code'];
+ expect(after.models).toEqual(NEW_MODELS);
+ expect(after.defaultModel).toBe('claude-sonnet-4-6'); // user pin survives
+ expect(after.heavyModel).toBe('claude-opus-4-8'); // opus tier still bumped
+ });
+
+ it('repairs an orphan opus-4-7 pointer when models are already the new trio', async () => {
+ writeJson(providersPath, {
+ providers: {
+ 'claude-code': {
+ id: 'claude-code',
+ models: [...NEW_MODELS],
+ defaultModel: 'claude-opus-4-7', // orphan: not in NEW_MODELS
+ lightModel: 'claude-haiku-4-5',
+ mediumModel: 'claude-sonnet-4-6',
+ heavyModel: 'claude-opus-4-8',
+ },
+ },
+ });
+
+ await migration.up({ rootDir });
+
+ const after = readJson(providersPath).providers['claude-code'];
+ expect(after.defaultModel).toBe('claude-opus-4-8');
+ expect(after.models).toContain(after.defaultModel);
+ });
+
+ it('is a no-op when models AND pointers are already opus-4-8', async () => {
+ const current = {
+ id: 'claude-code',
+ models: [...NEW_MODELS],
+ defaultModel: 'claude-opus-4-8',
+ lightModel: 'claude-haiku-4-5',
+ mediumModel: 'claude-sonnet-4-6',
+ heavyModel: 'claude-opus-4-8',
+ };
+ 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 sonnet, etc.)', async () => {
+ const customized = {
+ id: 'claude-code',
+ models: ['claude-haiku-4-5', 'claude-opus-4-7'],
+ defaultModel: 'claude-opus-4-7',
+ };
+ 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-7', 'claude-haiku-4-5', 'claude-sonnet-4-6'],
+ defaultModel: 'claude-opus-4-7',
+ };
+ 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': opus47Trio(),
+ 'claude-code-tui': opus47Trio({ 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-4-8');
+ expect(out['claude-code-tui'].defaultModel).toBe('claude-opus-4-8');
+ expect(out['codex'].models).toEqual(['codex-configured-default']);
+ });
+
+ it('does not touch the bedrock provider (different model ids)', async () => {
+ const bedrock = {
+ id: 'claude-code-bedrock',
+ models: ['us.anthropic.claude-opus-4-7-v1:0'],
+ defaultModel: 'us.anthropic.claude-opus-4-7-v1:0',
+ };
+ writeJson(providersPath, { providers: { 'claude-code-bedrock': bedrock } });
+ const beforeBytes = readFileSync(providersPath, 'utf-8');
+
+ await migration.up({ rootDir });
+
+ expect(readFileSync(providersPath, 'utf-8')).toBe(beforeBytes);
+ });
+
+ 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 a09b648a72..85b7a046d8 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-4-6", "claude-opus-4-7"],
- "defaultModel": "claude-opus-4-7",
+ "models": ["claude-haiku-4-5", "claude-sonnet-4-6", "claude-opus-4-8"],
+ "defaultModel": "claude-opus-4-8",
"lightModel": "claude-haiku-4-5",
"mediumModel": "claude-sonnet-4-6",
- "heavyModel": "claude-opus-4-7",
+ "heavyModel": "claude-opus-4-8",
"timeout": 300000,
"enabled": true,
"envVars": {},
@@ -78,11 +78,11 @@
"type": "tui",
"command": "claude",
"args": ["--dangerously-skip-permissions"],
- "models": ["claude-haiku-4-5", "claude-sonnet-4-6", "claude-opus-4-7"],
- "defaultModel": "claude-opus-4-7",
+ "models": ["claude-haiku-4-5", "claude-sonnet-4-6", "claude-opus-4-8"],
+ "defaultModel": "claude-opus-4-8",
"lightModel": "claude-haiku-4-5",
"mediumModel": "claude-sonnet-4-6",
- "heavyModel": "claude-opus-4-7",
+ "heavyModel": "claude-opus-4-8",
"timeout": 600000,
"enabled": true,
"envVars": {},
diff --git a/server/lib/aiToolkit/providers.js b/server/lib/aiToolkit/providers.js
index 3a1a97a265..39d5bda862 100644
--- a/server/lib/aiToolkit/providers.js
+++ b/server/lib/aiToolkit/providers.js
@@ -421,6 +421,7 @@ export function createProviderService(config = {}) {
async _fetchAnthropicModels(_provider) {
return [
+ 'claude-opus-4-8',
'claude-opus-4-7',
'claude-sonnet-4-6',
'claude-opus-4-5-20251101',
diff --git a/server/routes/scaffoldPortOS.js b/server/routes/scaffoldPortOS.js
index faeb619554..0b61dffa09 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-4-6', 'claude-opus-4-7'],
- defaultModel: 'claude-opus-4-7',
+ models: ['claude-haiku-4-5', 'claude-sonnet-4-6', 'claude-opus-4-8'],
+ defaultModel: 'claude-opus-4-8',
lightModel: 'claude-haiku-4-5',
mediumModel: 'claude-sonnet-4-6',
- heavyModel: 'claude-opus-4-7',
+ heavyModel: 'claude-opus-4-8',
timeout: 300000,
enabled: true,
envVars: {}