Skip to content

fix(runtime): don't inherit a foreign model across runtimes (v0.283.0) - #499

Merged
vikasprogrammer merged 1 commit into
mainfrom
feat/codex-model-inherit
Jul 31, 2026
Merged

fix(runtime): don't inherit a foreign model across runtimes (v0.283.0)#499
vikasprogrammer merged 1 commit into
mainfrom
feat/codex-model-inherit

Conversation

@vikasprogrammer

Copy link
Copy Markdown
Owner

Found on the first live attachable Codex session (#496), which came up as:

■ {"type":"error","status":400,"error":{"message":
   "The 'opus' model is not supported when using Codex with a ChatGPT account."}}
   opus high · ~/agent-os-data/instapods/agents/codex-scout

The fleet runtime default is model: "opus", codex-scout pins no model of its own, so the launcher handed opus straight to Codex.

Two holes, both mine

1. Aliases weren't caught. The guard added in #483 matched ^claude, so full ids like claude-opus-4-8 were refused — but the bare aliases people actually put in the workspace default (opus, sonnet, haiku, fable) went straight through. Patterns are now word-boundary anchored and cover both directions.

2. Inheritance was never validated — the bigger one. PUT /api/agents/:id/config rejects a foreign model, so I thought the trap was closed. It wasn't: the workspace default spans every runtime, so it cannot be correct for all of them at once, and an agent with no model of its own inherited it silently. No amount of per-agent validation catches that.

resolveRuntimeTuning now takes the runtime and drops a model that runtime can't run, so the session falls back to the CLI's own default — a working run rather than a dead one. Dropping beats erroring here: the workspace default is a fallback, and refusing to launch because a fleet-wide setting doesn't suit one runtime would be the wrong trade.

Verified

alias detection
  codex + opus / sonnet / haiku / fable / claude-opus-4-8 / Opus   rejected ✓
  codex + gpt-5-codex / glm-fast-latest                            accepted
  claude + gpt-5-codex / o3 / codex-mini                           rejected ✓

inheritance (workspace default model=opus — the live setting)
  codex agent, no own model              -> (inherit CLI default)
  claude agent, no own model             -> opus
  codex agent w/ own gpt-5-codex         -> gpt-5-codex
  codex agent w/ stale own model=opus    -> (inherit CLI default)
  no runtime given (back-compat)         -> opus

7 new conformance fixtures pin that matrix so it can't regress. Suite 130 → 137.

🤖 Generated with Claude Code

Found on the first live attachable Codex session. The fleet runtime default is
model="opus"; codex-scout pins no model of its own; so the launcher handed `opus`
to Codex, which replied "The 'opus' model is not supported when using Codex with
a ChatGPT account."

Two holes:

1. The cross-runtime guard only matched full ids (^claude), so bare ALIASES —
   opus/sonnet/haiku/fable — passed. Patterns are now word-boundary anchored and
   cover aliases both directions.

2. Nothing validated INHERITANCE. The per-agent config route rejects a foreign
   model, but the workspace default spans every runtime and so cannot be correct
   for all of them at once. resolveRuntimeTuning now takes the runtime and DROPS
   a model that runtime can't run, falling back to the CLI's own default — a
   working session instead of a dead one.

7 conformance fixtures pin the inheritance matrix. 137/137.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@vikasprogrammer
vikasprogrammer merged commit ef205b7 into main Jul 31, 2026
1 check passed
@vikasprogrammer
vikasprogrammer deleted the feat/codex-model-inherit branch July 31, 2026 10:16
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