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

fix(providers): accept a dotted Claude model id and spawn the dashed one

Adam Eivyeef3feb702c5
diff --git a/server/lib/README.md b/server/lib/README.md
index f9381d1a0b..8efc3490c2 100644
--- a/server/lib/README.md
+++ b/server/lib/README.md
@@ -163,7 +163,7 @@ The barrel `server/lib/index.js` is a machine-checkable enumeration of every pub
| `videoDurationProfiles.js` | Pure pinned duration/frame contracts shared by model-registry upgrades and migrations. LTX-2.5 A2V follows the full uploaded audio, rounds up to its 8n+1 temporal grid, and tops out at 1017 frames under the API's single-pass boundary. |
| `videoReferenceModes.js` | The i2v reference-mode contract (#4874) — what a supplied conditioning image PROMISES. `I2V_REFERENCE_MODES` (`anchor` \| `inspire`) + `I2V_REFERENCE_MODE_OPTIONS` (the label + the promise sentence the UI prints), `I2V_REFERENCE_MODE_RUNTIMES` (only `ltx25` can honor `inspire` — it needs per-image conditioning strength), `INSPIRE_DEFAULT_IMAGE_STRENGTH`, plus `normalizeI2vReferenceMode` / `isDefaultI2vReferenceMode` / `isKnownI2vReferenceMode` / `runtimeSupportsI2vReferenceMode` / `i2vReferenceModeLabel` / `resolveI2vReferenceStrength` and the one rule `i2vReferenceModeViolation({ model, mode, referenceMode, hasFirstImage })` → `{ code, message }` or null. Pure (no `ServerError`) because it is MIRRORED to `client/src/lib/videoReferenceModes.js`; `videoGen/modeContract.js#videoReferenceModeError` wraps it for the route + render boundaries. |
| `videoTextEncoders.js` | Swappable prompt conditioners for local video runtimes. MiniMax H3 reads the *unnormalized* hidden state after Qwen3-VL language layer 49 (layers 50-63, the final norm and `lm_head` are never evaluated), so any checkpoint carrying the same embedding + layers 0-49 + vision tower is a drop-in conditioner — swapping it changes how the model reads a prompt without touching the diffusion weights. `TEXT_ENCODERS_BY_RUNTIME` declares the shipped options per runtime (pinned repo/revision plus an explicit `files` LIST — one repackaged safetensors, or just the shards of an upstream checkpoint that carry parameters the loader actually builds; in code rather than the media-models registry so a stale `data/media-models.json` can't name a file the runner can't map); `videoTextEncoderOptions(model)` returns the TRUE list stock-first (it deliberately does NOT collapse a one-entry runtime to `[]` — that is a presentation rule, and folding it in here would change what the server believes a model supports and empty the "offers …" list in the error; `TextEncoderPicker` owns the hide-when-there-is-no-real-choice check), `isStockTextEncoder(id)` makes absence and the `stock` sentinel the same request, `resolveVideoTextEncoder(model, id)` returns `null` for the stock choice or throws `VIDEO_TEXT_ENCODER_UNSUPPORTED` (with the non-throwing `supportsVideoTextEncoder` + `videoTextEncoderUnsupportedError` split out so the request path can reject before staging uploads), and `downloadableVideoTextEncoders()` (deduped by id — the table is keyed by RUNTIME, so one conditioner can be offered by two) / `downloadableVideoTextEncoder(id)` feed the `/api/video-gen/text-encoders/:id/(download\|repair)` lane. Two loader-mechanics fields exist because a ComfyUI-packaged conditioner is namespaced differently from the HF checkpoint the MLX port matches: `keyPrefixMap` (`model.` → `model.language_model.`, `visual.` → `model.visual.`) is applied to every checkpoint key by `scripts/generate_minimax_h3.py` BEFORE the pinned loader sees it — no fork of the pinned runtime — and `finalNormKey` names where the runner synthesizes a ones-filled `norm.weight` for a checkpoint published without one (correct upstream, since H3 reads the state *before* the norm, but the pinned loader refuses to load with any parameter missing). Both are absent for an UPSTREAM Qwen3-VL-32B checkpoint, which already uses the loader namespace and ships its own norm. A candidate must BE Qwen3-VL-32B (the shim reuses upstream's config/tokenizer/processor) — a different Qwen generation is not a substitute however close its conditioning width looks; see docs/features/video-text-encoders.md. `publicTextEncoderOption(entry)` is the client projection and deliberately drops both, so the UI can't reimplement the remap. The `ltx25` table (#4320) uses a third mechanic, `configOverrides`, because an LTX-2.5 pack's OWN Gemma 4 tower wins over `--gemma` inside the pinned fork: the substitution is a standalone shim directory whose generated `config.json` is the substitute's own with these keys merged over it (only ever the `model_type` label a unified checkpoint gets wrong — never `text_config`/`quantization`), and a candidate must BE Gemma 4 12B at 48 layers / hidden 3840 / vocab 262144 / `k_eq_v`. `verified` gates a substitute out of BOTH lanes (picker AND download) until it has been A/B-rendered against its runtime's stock conditioner — required on every non-built-in entry and fail-closed on absence, so a new entry is unreachable until someone states a verdict; both ltx25 substitutes are `verified: false` today. `declaredVideoTextEncoders()` is the UNFILTERED table for shape/invariant checks only — never the render or download path, and `videoTextEncoderRuntimes()` enumerates the table's runtime keys so parity/shape tests cover every runtime rather than the one that happened to exist when they were written. |
-| `providerModels.js` | Provider model resolution sentinels + helpers (`CODEX_CONFIGURED_DEFAULT` / `ANTIGRAVITY_CONFIGURED_DEFAULT` / `GROK_CONFIGURED_DEFAULT` / `KIMI_CONFIGURED_DEFAULT`, `resolveCliModel`, `filterSelectableModels`, Bedrock/OpenCode model mappers, model-flag scan helpers incl. `stripBrokenModelFlags`, `isCodexProvider`, `isKimiProvider`, `isAntigravityProvider`, `isCursorProvider`) plus reasoning-effort helpers for the claude/codex/agy/cursor CLIs (`CLAUDE_EFFORT_LEVELS` / `CODEX_EFFORT_LEVELS` / `ANTIGRAVITY_EFFORT_LEVELS` / `CURSOR_EFFORT_LEVELS` / `EFFORT_LEVELS`, `effortLevelsForProvider`, `resolveCliEffort` — clamps an out-of-range effort to the nearest level the target CLI accepts rather than dropping it, so a value saved against a wider ladder survives a provider switch — `hasEffortFlag`, `buildEffortArgs` — the one emitter of `--effort <level>` / `-c model_reasoning_effort=<level>`, and deliberately silent for cursor — and `foldCursorEffortIntoModel`, which carries a cursor level inside `--model` as Cursor’s own variant syntax (`gpt-5[effort=max]`) because `cursor-agent` has no `--effort` flag) plus codex startup-arg helpers (`CODEX_EFFORT_KEY`, `CODEX_UPDATE_CHECK_KEY`, `hasCodexUpdateCheckConfig`, `buildCodexStartupArgs` — the one emitter of `-c check_for_update_on_startup=false`, spread by every codex spawn builder to disable the blocking startup update modal) plus `PORTOS_CLI_CONFIG_KEYS` / `isPortosSuppliedConfigKey` — the exhaustive list of `-c <key>=<value>` config keys PortOS injects, read by the `cli-config-invalid` error analyzer to tell a rejected PortOS override apart from a bad line in the user's own CLI config file. |
+| `providerModels.js` | Provider model resolution sentinels + helpers (`CODEX_CONFIGURED_DEFAULT` / `ANTIGRAVITY_CONFIGURED_DEFAULT` / `GROK_CONFIGURED_DEFAULT` / `KIMI_CONFIGURED_DEFAULT`, `resolveCliModel`, `filterSelectableModels`, Bedrock/OpenCode model mappers, `normalizeClaudeModelId` / `resolveClaudeCliModel` — the Claude-argv chokepoint that rewrites a dotted first-party version (`claude-fable-5.1`) to the dashed id Claude Code actually serves before the Bedrock mapping runs, model-flag scan helpers incl. `stripBrokenModelFlags`, `isCodexProvider`, `isKimiProvider`, `isAntigravityProvider`, `isCursorProvider`) plus reasoning-effort helpers for the claude/codex/agy/cursor CLIs (`CLAUDE_EFFORT_LEVELS` / `CODEX_EFFORT_LEVELS` / `ANTIGRAVITY_EFFORT_LEVELS` / `CURSOR_EFFORT_LEVELS` / `EFFORT_LEVELS`, `effortLevelsForProvider`, `resolveCliEffort` — clamps an out-of-range effort to the nearest level the target CLI accepts rather than dropping it, so a value saved against a wider ladder survives a provider switch — `hasEffortFlag`, `buildEffortArgs` — the one emitter of `--effort <level>` / `-c model_reasoning_effort=<level>`, and deliberately silent for cursor — and `foldCursorEffortIntoModel`, which carries a cursor level inside `--model` as Cursor’s own variant syntax (`gpt-5[effort=max]`) because `cursor-agent` has no `--effort` flag) plus codex startup-arg helpers (`CODEX_EFFORT_KEY`, `CODEX_UPDATE_CHECK_KEY`, `hasCodexUpdateCheckConfig`, `buildCodexStartupArgs` — the one emitter of `-c check_for_update_on_startup=false`, spread by every codex spawn builder to disable the blocking startup update modal) plus `PORTOS_CLI_CONFIG_KEYS` / `isPortosSuppliedConfigKey` — the exhaustive list of `-c <key>=<value>` config keys PortOS injects, read by the `cli-config-invalid` error analyzer to tell a rejected PortOS override apart from a bad line in the user's own CLI config file. |
| `providerVendors.js` | `PROVIDER_VENDORS` — one row per coding-agent CLI/TUI vendor (claude/codex/antigravity/opencode/grok/kimi/cursor, plus a deliberately-incomplete legacy `gemini-cli` row), consumed by every dispatch site that used to hand-roll its own vendor if-chain across ~8 branches in 5 files (#3618): `applyCommandDefaults`/`prepareCliPrompt` (re-exported from `tuiHandshake.js`/`cliProviderArgs.js`), `buildVendorCliArgs`/`buildVendorSpawnConfig` (consumed by `cliProviderArgs.js#buildCliArgs` / `agentCliSpawning.js#buildCliSpawnConfig`), `inferTuiCommand` (re-exported from `tuiHandshake.js`), and `injectTuiModelAndEffort` — the shared antigravity-validates-the-pair-vs-everyone-else `--model`/`--effort` injection used by both `tuiHandshake.js#buildTuiInvocation` and `agentTuiSpawning.js#buildTuiSpawnConfig`, replacing a second copy of that split that had already drifted once before this file existed. Doesn't rewrite any vendor's argv-building logic — that stays in `antigravity.js`/`grok.js`/`kimi.js`/`cursor.js`/`codex.js`. Dependency-light on purpose, mirroring those files. |
| `modelCapabilityTests.js` | Catalog + scoring for the CAPABILITY tests on `/models/performance` (run by `services/modelCapabilityTests.js`): `CAPABILITY_TESTS` (sandbox repair / image analysis / story outline / fiction scene / rhetoric evaluator, each gated on the capability badges the install catalog already shows), `applicabilityFor` + `applicableTests` (`applicable` / `not-applicable` / `unknown` — an UNCLAIMED capability is never a failure, and `null` capabilities mean the runtime reported none, which is distinct from `[]`), `scoreKeywords` + `VISION_FIXTURE_KEYWORDS` (required vs bonus terms, word-boundary matched with a negation guard so "no dog" doesn't score a dog), `scoreStoryBeats` + `HEROS_JOURNEY_BEATS` (coverage AND ordering, judged only over the beats present), `scoreSandboxRepair` (verdict from observed disk facts — editing the test instead of the module fails outright), `formatAgentEvent` (one agent stream frame → a transcript line), `rollUpVerdict`, and the verbatim `CAPABILITY_TEST_PROMPTS` / `SANDBOX_TASK_PROMPT` the consent gate shows. Pure, so any stored transcript can be re-scored with no provider call. |
| `modelPricing.js` | Per-model API billing rates for the /devtools/usage cost estimates — `resolveModelRates(providerId, model)` (exact → family regex → provider default → blended fallback, with a `matched` tier; also derives `cacheReadPer1M`/`cacheWritePer1M` from the input rate via per-family multipliers), `isFreeProvider` (ollama/lmstudio/`ollamaBacked`/localhost = free), `estimateCostUsd(tokensIn, tokensOut, rates, cache?)` — `tokensIn` is UNCACHED input; cache tiers are priced separately via the optional 4th arg — and `PRICING_AS_OF`. Informational only (PortOS runs on subscriptions); still excludes batch/long-context tiers. |
diff --git a/server/lib/cliProviderArgs.test.js b/server/lib/cliProviderArgs.test.js
index 95cf8c3db1..efa6f450b7 100644
--- a/server/lib/cliProviderArgs.test.js
+++ b/server/lib/cliProviderArgs.test.js
@@ -266,6 +266,13 @@ describe('cliProviderArgs', () => {
'claude-sonnet-4-6',
];
+ it('canonicalizes a dotted Claude model id — the CLI only serves the dashed form', () => {
+ const spy = vi.spyOn(console, 'error').mockImplementation(() => {});
+ expect(buildCliArgs({ id: 'claude-code', command: 'claude', defaultModel: 'claude-fable-5.1' }))
+ .toEqual(['-p', '-', '--model', 'claude-fable-5-1']);
+ spy.mockRestore();
+ });
+
it('emits --effort for Claude Code', () => {
expect(buildCliArgs({ id: 'claude-code', command: 'claude', defaultModel: 'claude-opus-5', effort: 'max' }))
.toEqual(['-p', '-', '--model', 'claude-opus-5', '--effort', 'max']);
diff --git a/server/lib/providerModels.js b/server/lib/providerModels.js
index 0db62639cf..3e15a97ee0 100644
--- a/server/lib/providerModels.js
+++ b/server/lib/providerModels.js
@@ -732,6 +732,66 @@ export function resolveBedrockCliModel(id, { env = process.env, providerId } = {
return mapped;
}
+/**
+ * Claude Code's first-party model ids spell a version with DASHES
+ * (`claude-fable-5-1`, `claude-opus-4-8`), while the release is spoken and
+ * written with a dot ("Fable 5.1"). A stored `claude-fable-5.1` therefore looks
+ * right in the picker and is rejected by the CLI at spawn time — the run dies
+ * with "model not found", the task blocks, and nothing about the id says why.
+ *
+ * This canonicalizes the dotted spelling to the dashed one, and ONLY that:
+ *
+ * - the id must start with a first-party family prefix (`claude-opus-`,
+ * `claude-sonnet-`, `claude-haiku-`, `claude-fable-`), so a vendor id that
+ * merely mentions Claude (cursor's `claude-4.6-sonnet-medium`) is untouched;
+ * - only a dot BETWEEN DIGITS is rewritten, leaving any other dot alone;
+ * - a Bedrock region-prefixed id (`global.anthropic.…`) is left alone, since
+ * its prefix dots are structural.
+ *
+ * @param {string|null|undefined} id
+ * @returns {string|null|undefined} the canonical id (or the input unchanged)
+ */
+export function normalizeClaudeModelId(id) {
+ if (typeof id !== 'string' || !id) return id;
+ if (hasBedrockRegionPrefix(id)) return id;
+ if (!/^claude-(?:opus|sonnet|haiku|fable)-/i.test(id)) return id;
+ return id.replace(/(\d)\.(?=\d)/g, '$1-');
+}
+
+// Dedup so the canonicalization notice prints once per (provider, model) per
+// process rather than on every run, matching `warnBareBedrockModel`.
+const _warnedDottedClaudeModels = new Set();
+
+/**
+ * The model string a Claude Code spawn should pass to `--model`: canonicalize a
+ * dotted first-party id, then map it to its Bedrock form when the box is in
+ * Bedrock mode. The single home for both corrections, called from every
+ * Claude-command argv builder (`claudeCliArgs`, `claudeSpawnArgs`,
+ * `resolveInjectedTuiModel`) so a fix in one is a fix in all.
+ *
+ * Deliberately NOT folded into `resolveBedrockCliModel`: that helper is also the
+ * documented Bedrock-only mapper, and the dot rewrite is gated on the caller
+ * already having resolved a Claude *Code* command — cursor and friends label
+ * Anthropic models under their own dotted ids and must not be rewritten.
+ *
+ * @param {string|null|undefined} id
+ * @param {{env?:NodeJS.ProcessEnv, providerId?:string}} [opts]
+ * @returns {string|null|undefined}
+ */
+export function resolveClaudeCliModel(id, { env = process.env, providerId } = {}) {
+ const canonical = normalizeClaudeModelId(id);
+ if (canonical !== id) {
+ const key = `${providerId || 'claude-code'}::${id}`;
+ if (!_warnedDottedClaudeModels.has(key)) {
+ _warnedDottedClaudeModels.add(key);
+ console.error(
+ `⚠️ Provider '${providerId || 'claude-code'}' model '${id}' spells its version with a dot — Claude Code only serves the dashed id, using '${canonical}' for this run (update the provider's model list to silence).`,
+ );
+ }
+ }
+ return resolveBedrockCliModel(canonical, { env, providerId });
+}
+
/**
* The model string a TUI spawn should actually pass to `--model`, given the
* resolved launch command. The single home for a decision that used to be
@@ -742,8 +802,10 @@ export function resolveBedrockCliModel(id, { env = process.env, providerId } = {
* only answers "which id".
*
* - OpenCode: namespace a bare Ollama id (`ollama/<id>`); never Bedrock-mapped.
- * - Claude Code: map a bare Claude id to its region-prefixed Bedrock form when
- * the box is in Bedrock mode (no-op off Bedrock / for non-Claude ids).
+ * - Claude Code: canonicalize a dotted first-party id (`claude-fable-5.1` →
+ * `claude-fable-5-1`), then map a bare Claude id to its
+ * region-prefixed Bedrock form when the box is in Bedrock mode
+ * (no-op off Bedrock / for non-Claude ids).
* - Anything else: passed through verbatim.
*
* The Bedrock arm is deliberately OPT-IN on the launch command rather than the
@@ -766,7 +828,7 @@ export function resolveBedrockCliModel(id, { env = process.env, providerId } = {
export function resolveInjectedTuiModel(model, provider, command = provider?.command) {
if (isOpencodeCommand(command)) return prefixOpencodeModel(provider, model);
if (!isClaudeCommand(command)) return model;
- return resolveBedrockCliModel(model, {
+ return resolveClaudeCliModel(model, {
env: { ...process.env, ...provider?.envVars },
providerId: provider?.id,
});
diff --git a/server/lib/providerModels.test.js b/server/lib/providerModels.test.js
index 1a3d66e74e..cd69c82c45 100644
--- a/server/lib/providerModels.test.js
+++ b/server/lib/providerModels.test.js
@@ -14,6 +14,8 @@ import {
hasBedrockRegionPrefix,
toBedrockModelId,
resolveBedrockCliModel,
+ normalizeClaudeModelId,
+ resolveClaudeCliModel,
prefixOpencodeModel,
getOpencodeLocalProviderNamespace,
isOpencodeCommand,
@@ -900,6 +902,74 @@ describe('providerModels', () => {
});
});
+ // Real input matrix for a rewrite that silently changes the id handed to the
+ // CLI — a wrong match here mangles another vendor's model, and a missed one
+ // blocks a task with "model not found" — which is what a stored
+ // `claude-fable-5.1` did.
+ describe('normalizeClaudeModelId', () => {
+ it('rewrites a dotted first-party version to the dashed id Claude Code serves', () => {
+ expect(normalizeClaudeModelId('claude-fable-5.1')).toBe('claude-fable-5-1');
+ expect(normalizeClaudeModelId('claude-opus-4.8')).toBe('claude-opus-4-8');
+ expect(normalizeClaudeModelId('claude-haiku-4.5-20251001')).toBe('claude-haiku-4-5-20251001');
+ });
+
+ it('leaves an already-canonical or non-first-party id alone', () => {
+ for (const id of [
+ 'claude-fable-5-1',
+ 'claude-opus-5',
+ 'claude-haiku-4-5-20251001',
+ // Cursor labels Anthropic models under its OWN dotted ids.
+ 'claude-4.6-sonnet-medium',
+ 'claude-opus-5-thinking-high',
+ // Other vendors' dotted ids never start with a Claude family prefix.
+ 'gpt-5.3-codex',
+ 'gemini-3.1-pro',
+ 'hf.co/some/repo-fable5-v1-GGUF:Q4_K_M',
+ ]) {
+ expect(normalizeClaudeModelId(id), id).toBe(id);
+ }
+ });
+
+ it('leaves a Bedrock region-prefixed id alone — its dots are structural', () => {
+ expect(normalizeClaudeModelId('global.anthropic.claude-fable-5-v1:0'))
+ .toBe('global.anthropic.claude-fable-5-v1:0');
+ });
+
+ it('passes empty/non-string input through', () => {
+ expect(normalizeClaudeModelId('')).toBe('');
+ expect(normalizeClaudeModelId(null)).toBeNull();
+ expect(normalizeClaudeModelId(undefined)).toBeUndefined();
+ });
+ });
+
+ describe('resolveClaudeCliModel', () => {
+ it('canonicalizes a dotted id and warns once per provider+model', () => {
+ const spy = vi.spyOn(console, 'error').mockImplementation(() => {});
+ const opts = { env: {}, providerId: 'claude-code-dotted-test' };
+ expect(resolveClaudeCliModel('claude-fable-5.1', opts)).toBe('claude-fable-5-1');
+ expect(resolveClaudeCliModel('claude-fable-5.1', opts)).toBe('claude-fable-5-1');
+ expect(spy).toHaveBeenCalledTimes(1);
+ expect(spy.mock.calls[0][0]).toMatch(/claude-fable-5\.1/);
+ spy.mockRestore();
+ });
+
+ it('canonicalizes BEFORE the Bedrock rewrite, so Bedrock gets the dashed id', () => {
+ const spy = vi.spyOn(console, 'error').mockImplementation(() => {});
+ expect(resolveClaudeCliModel('claude-fable-5.1', {
+ env: { CLAUDE_CODE_USE_BEDROCK: '1' },
+ providerId: 'claude-code-dotted-bedrock-test',
+ })).toBe('global.anthropic.claude-fable-5-1');
+ spy.mockRestore();
+ });
+
+ it('stays silent for an id that needs no correction', () => {
+ const spy = vi.spyOn(console, 'error').mockImplementation(() => {});
+ expect(resolveClaudeCliModel('claude-fable-5-1', { env: {} })).toBe('claude-fable-5-1');
+ expect(spy).not.toHaveBeenCalled();
+ spy.mockRestore();
+ });
+ });
+
// Both TUI spawn paths (tuiHandshake.js#buildTuiInvocation and
// agentTuiSpawning.js#appendModelArgs) delegate here, so this is the single
// place the "which model id do we actually pass" rule is decided. It used to
diff --git a/server/lib/providerVendors.js b/server/lib/providerVendors.js
index 6f69bcb201..a730776295 100644
--- a/server/lib/providerVendors.js
+++ b/server/lib/providerVendors.js
@@ -62,7 +62,7 @@ import {
isClaudeCommand,
hasModelFlag,
resolveInjectedTuiModel,
- resolveBedrockCliModel,
+ resolveClaudeCliModel,
buildCodexStartupArgs,
buildCodexAgentThreadArgs,
buildEffortArgs,
@@ -283,7 +283,7 @@ const GEMINI_LEGACY = {
function claudeCliArgs(baseArgs, { model, effort, provider }) {
const args = [...baseArgs, '-p', '-'];
if (model && !hasModelFlag(baseArgs)) {
- const resolvedModel = resolveBedrockCliModel(model, {
+ const resolvedModel = resolveClaudeCliModel(model, {
env: { ...process.env, ...provider?.envVars },
providerId: provider?.id || '',
});
@@ -307,7 +307,7 @@ function claudeSpawnArgs(provider, { effectiveModel, effort, systemPromptFile, s
args.push('--append-system-prompt-file', systemPromptFile);
}
if (effectiveModel) {
- const injectedModel = resolveBedrockCliModel(effectiveModel, {
+ const injectedModel = resolveClaudeCliModel(effectiveModel, {
env: { ...process.env, ...settingsEnv, ...provider?.envVars },
providerId,
});
diff --git a/server/lib/tuiHandshake.test.js b/server/lib/tuiHandshake.test.js
index 7e50af6627..ad28e73c2f 100644
--- a/server/lib/tuiHandshake.test.js
+++ b/server/lib/tuiHandshake.test.js
@@ -699,6 +699,14 @@ describe('tuiHandshake.buildTuiInvocation', () => {
expect(out.args).toEqual(['--force', '--model', 'auto']);
});
+ it('canonicalizes a dotted Claude model id for the TUI spawn (regression: claude-fable-5.1)', () => {
+ const spy = vi.spyOn(console, 'error').mockImplementation(() => {});
+ const provider = { id: 'claude-code-tui', command: 'claude', args: ['--dangerously-skip-permissions'] };
+ const out = buildTuiInvocation(provider, 'claude-fable-5.1');
+ expect(out.args).toEqual(['--dangerously-skip-permissions', '--model', 'claude-fable-5-1']);
+ spy.mockRestore();
+ });
+
it('injects --force when a cursor provider’s saved args dropped it', () => {
const out = buildTuiInvocation({ id: 'cursor-tui', command: 'cursor-agent', args: [] }, null);
expect(out.args).toEqual(['--force']);