fix(#3714): deliver an explicitly pinned model to the Codex worktree executor, and drop an unusable one (#3891)

* test(#3714): failing-first coverage for the dropped Codex worktree model override

Pins the argv contract for the orchestrator-worktree process dispatch: an explicit
model_overrides pin must reach the child as --model, while an unpinned, empty,
inherit, or profile-only configuration must emit no flag at all.

Five of the eight matrix rows are CONTROLS that pass before the fix. They carry the
weight here because this is an over-emission bug waiting to happen: resolve-model
returns 'sonnet' for the unpinned, empty and profile-only cases, so a fix that
threads its return value into argv would satisfy the positive row and emit
--model sonnet to Codex on every unpinned install -- the documented 400 that
ADR-2313 exists to prevent. The controls are what separate the correct fix from
the obvious one.

* fix(#3714): deliver an explicitly pinned model to the Codex worktree executor

resolveOrchestratorExec had no model input at all -- the descriptor carried only
command/args/cwdFlag/promptFlag -- so a resolved override had no way to reach the
spawned process even in principle. The baked gsd-executor.toml could not compensate
because this path spawns a process rather than dispatching a named agent.

Three parts, and the third is the load-bearing one.

The descriptor gains modelFlag (codex: --model), keeping the per-host knowledge as
descriptor data exactly as cwdFlag and promptFlag already are, so the scheduler
grows no per-host branch. No other runtime declares it.

The seam appends [modelFlag, model] and stays MECHANICAL: it does not know the
inherit sentinel, does not know which models Codex rejects, and reads no config.
Its sibling codex-agent-toml states that rule outright -- callers decide what to
strip. Argv order is baseArgs, model, cwd, prompt so the prompt remains the final
positional token. Omitting the model is byte-identical to before. A model starting
with '-' now fails closed as unsafe_leading_dash_model, the same hazard the prompt
and cwd guards already reject and which was silently accepted before.

The policy lives at the caller and passes ONLY an explicit, non-sentinel per-agent
pin. Passing null as the runtime resolver is what keeps profile and tier derived
models out of argv, which is what Codex's session-only model posture requires: the
model resolver returns 'sonnet' for the unpinned, empty and profile-only cases, and
emitting that revives the documented 400 from #2310/#2311 that ADR-2313 removed. So
the gate is the presence of an explicit pin, never that a value came back.

* fix(#3714): enforce the real-Codex value policy the sibling surface already applies

Review found one root cause behind a BLOCKER, two MAJORs, two MINORs and an
argv-injection finding: the dispatch path gated on the PRESENCE of an explicit pin
but never applied the VALUE policy that generateCodexAgentToml already applies to
the same config key. Textbook generative divergence -- and the parity row I wrote
tested resolver parity, not this policy, so it could never have caught it.

BLOCKER: a global ~/.gsd/defaults.json model_overrides.gsd-executor of 'sonnet',
'opus' or 'claude-sonnet-4-5' reached codex exec --model verbatim. That is the
documented 400 from #2310/#2311, arriving through the explicit-pin door rather
than the tier door. The issue asks for an explicit REAL-CODEX pin; real-Codex was
unenforced. Now dropped with a warning via the isAnthropicFlavoredModel predicate
#3241 single-sourced for exactly this reason.

Also: values are trimmed, so a whitespace-only pin is blank rather than
--model "   "; 'inherit' is matched case- and whitespace-insensitively, so
'Inherit' and ' inherit ' no longer reach the wire; and a value outside a model-id
charset is dropped with a warning. That last one closes the injection surface --
.planning/config.json travels with a clone, and values like
'gpt-5 -c approval_policy=never' or a command-substitution value previously reached argv verbatim,
where the spawner is an agent writing bash.

Every rejection DROPS AND WARNS rather than failing closed. An unusable exec is not
degraded, it is fatal: the dispatch step halts the wave after the worktree already
exists, so a config typo would have aborted execute-phase. The stale comment
claiming it degrades to sequential is corrected.

Separately, the seam's own empty-model handling contradicted the committed contract
and failed four tests on the remote runner. An absent, null or empty model is not an
error -- it means use the host default, the same degradation cwdFlag:null already
expresses. Unlike a prompt, where empty is a hang rather than a degraded run, so
that one stays fail-closed. Non-string values still fail closed.

Tests: the CLI rows were not HOME-hermetic and read the developer's real
~/.gsd/defaults.json, which is precisely the file the BLOCKER is about; HOME and
USERPROFILE are now sandboxed per call. Adds the global-pin regression, the
injection shapes, the case-variant inherit rows, and a real cross-surface
divergence guard.

* fix(#3714): close the flag-shaped pin, the case-variant alias, and the warning sink

Round two of review found three more defects, two of which both engines reached
independently, and all three were mine.

The charset allowlist put the dash INSIDE the character class, so a value made only
of allowed characters passed the pin policy silently and then tripped the seam's
leading-dash guard, producing exec:null. That is the wave-fatal path the whole
drop-and-warn design exists to avoid, reachable from a committed config file: -c,
--config, -p and --dangerously-skip-permissions all reproduced it. It also regressed
hosts with no model flag at all, where a dash pin turned a previously working
kimi-code dispatch into exec:null. The first character is now anchored, so a
flag-shaped value is dropped and warned like every other rejection, and the comment
that claimed this path was unreachable is corrected.

isAnthropicFlavoredModel folded case on its substring arm but not on its alias-set
arm, so SONNET, Sonnet, OPUS and HAIKU all reached Codex argv while lowercase sonnet
was correctly dropped -- the same 400 the drop exists to prevent. The predicate is
the one #3241 single-sourced so these surfaces cannot diverge, so folding case there
fixes the install-side .toml surface too.

The warning wrote the rejected value RAW to stderr. Every value that fails the
charset test contains by definition the characters the charset excludes, so it was a
guaranteed-reachable raw-to-terminal sink: an OSC sequence in a committed config
reached the operator's terminal byte for byte, and truncation could sever an escape
before its reset. The value is now sanitized before truncation.

Also from review: the allowlist rejected Vertex version pins like text-bison@002, a
false positive on a real model id; the policy ran host-neutrally so hosts with no
model flag printed a misleading drop warning on every dispatch; the invalid_model
branch had no test at all; and the changeset disclosed only that a pin is delivered,
not that an unusable one is now dropped with a warning.

* fix(#3714): single-source the model-id charset, bound the pin, keep the flag diagnosis

Round three found no blocking findings on either engine. These are the three
correctness items left in code I added.

The charset existed TWICE -- once to accept a pin, once to render a rejected one in
the warning -- and the two copies had already drifted inside a single commit: '@'
was added to the accept class and not the render class, so a Vertex-shaped value
rejected for some other reason rendered as text-bison?002. Both are now derived
from one definition, with a parity test asserting every character the matcher
accepts survives the sanitizer unchanged, so they cannot drift again.

A pin reached argv unbounded. CLAUDE.md documents the hazard: execFileSync aborts
on Windows above 32,767 characters of argv. A model id has no reason to be long, so
a pin over 200 characters is dropped and warned rather than truncated -- a truncated
model id is a different model id. Boundary rows at 199, 200 and 201.

The first character is now required to be alphanumeric, so '@evil' and '/c' no
longer reach argv. Security rates both inert on codex today, so this is hardening
rather than a live defect; it is here because it is one character of regex and
resolveOrchestratorExec documents itself as a general descriptor-to-argv seam that
other hosts may adopt.

Tightening the anchor made the leading-dash branch unreachable and, with it,
regressed the diagnosis: '-c' began reporting 'unsafe characters' instead of
'looks like a flag/option'. The dash check now runs before the charset test, which
both restores the actionable message for the most likely user typo and keeps the
branch live. A test pins the distinction between the three rejection messages so
the branch cannot silently die again.

* test(#3714): make the charset parity guard actually guard, and remove a false-green trap

Review proved by mutation that my parity test could not do what its own comment
claimed. It bound the expected character set to a local that was assigned and
discarded, and the shared definition was not exported, so widening that definition
left the test green. A comment overstating what a test guards is worse than no
comment, because the next reader trusts it. The shared body is now exported and
asserted equal, and I watched the assertion fail against a widened definition
before keeping it.

The sanitizer regex was module-scope, carried the g flag and was exported.
Production only uses it with replace, which resets lastIndex, so there was no live
bug -- but test() on a g-flagged regex alternates between calls, so any future test
reaching for it would false-green. The g-flagged copy is now internal to the one
call site that needs it and the exported companion carries no flags, which removes
the footgun rather than documenting it.

Also notes at the shared definition that it is interpolated into both a positive and
a negated character class, so only plain characters and ranges are safe to add.

No runtime behavior changes: the accept set, the anchor, the length cap, the
sanitizer output, the rejection ordering and all three message texts are
byte-identical, re-verified through the real CLI.

* chore(#3714): backfill changeset pr number

* chore(#3714): re-trigger CI after the GitHub Actions outage

The workflow runs for this branch were created during the Actions major outage on
2026-08-26 and never got scheduled. They are wedged: GitHub reports them queued,
refuses to cancel them, and refuses to rerun them because it believes the workflow
is already running. The Tests run is also pinned to a superseded sha, so no test run
exists for the current head at all.

Actions is operational again and the repo-wide queue has drained, so a fresh push is
what creates schedulable runs. This commit is empty on purpose: nothing about the
change is being altered, and the verified content is byte-identical to 7860c6ccc.

---------

Co-authored-by: sim <sim@local>
This commit is contained in:
Tom Boucher
2026-08-26 17:01:09 -04:00
committed by GitHub
parent c1f755d75d
commit a3d5841117
9 changed files with 1306 additions and 12 deletions

View File

@@ -1778,6 +1778,155 @@ function dispatchOverlayCapabilityCommand({ command, args, cwd, raw, error, load
}
}
// #3714 follow-up — the dispatch seam gated only on PRESENCE of an explicit
// pin, never on its VALUE, so an Anthropic-flavored global default
// (~/.gsd/defaults.json model_overrides["gsd-executor"] = "sonnet"/"opus"/
// "claude-*") reached `codex exec --model sonnet`: the documented #2310/
// #2311 400 on a passive-posture host (ADR-1239/ADR-2313). It also let a
// repo-committed .planning/config.json inject shell-hostile argv (a
// `-c approval_policy=never` suffix, `$(...)`/`;` command injection,
// embedded control characters) straight onto exec's argv.
//
// This mirrors — deliberately, not by re-derivation — the same VALUE
// policy bin/install.js's generateCodexAgentToml() already applies to the
// identical model_overrides["gsd-executor"] config key for the .toml
// surface (bin/install.js ~3983-4046): trim; a whitespace-only value drops
// silently (#3241, no warning); an Anthropic-flavored value
// (isAnthropicFlavoredModel, single-sourced on bin/lib/model-catalog.cjs
// per #3241 specifically so it cannot diverge across Codex-posture
// surfaces) drops WITH a warning; a real pin survives verbatim. Two
// additions beyond the .toml surface, both specific to this seam: the
// 'inherit' sentinel (case/whitespace-insensitive) is a no-op here already
// and must stay one, and a value that doesn't look like a model id at all
// (the injection case above — the .toml surface never had to consider this
// because TOML string-quoting isn't a shell argv boundary) is dropped with
// a warning rather than ever reaching child_process argv.
// Single source of truth for the model-id "allowed characters" notion
// (#3714 follow-up — "Generative Fix Divergence"): the accept regex
// (MODEL_ID_CHARSET_RE, used to ADMIT a pin) and the sanitizer keep-class
// (MODEL_ID_SANITIZE_STRIP_RE, used to RENDER a rejected pin into a
// warning) are both derived from this one character-class body so they
// cannot drift apart again the way they already did once (the '@' added
// for Vertex pins landed in the accept regex but not the sanitizer,
// rendering "text-bison@002" as "text-bison?002" in the warning). '@' is
// included for Vertex model-version pins ("text-bison@002",
// "chat-bison@001"), which are legitimate model ids reachable through a
// custom model_provider.
// This body is interpolated raw into BOTH a positive character class
// (MODEL_ID_CHARSET_RE, `[BODY]`) and a negated one
// (MODEL_ID_SANITIZE_STRIP_RE, `[^BODY]`) below — only plain characters
// and `x-y` ranges are safe here. A class metacharacter (`^`, `]`, `\`)
// would mean different things in the two derived regexes if ever added.
const MODEL_ID_CHARSET_BODY = 'A-Za-z0-9._:/@-';
// The first character must be alphanumeric (#3714 hardening): a leading
// '.', '_', ':', '/', or '@' has no legitimate model-id use case and, for
// resolveOrchestratorExec's documented role as a GENERAL descriptor→argv
// seam other hosts may adopt, a leading '@' or '/' is exactly the shape an
// @-response-file or /-switch parser would key on. The leading-dash shape
// is enforced separately by LEADING_DASH_RE below — it is NOT relaxed
// here, since a flag-shaped value ("-c", "--config") must still fail the
// resolver's own unsafe_leading_dash_model guard path via that dedicated
// check, not this charset.
const MODEL_ID_CHARSET_RE = new RegExp(`^[A-Za-z0-9][${MODEL_ID_CHARSET_BODY}]*$`);
// Keep-class for sanitizing a REJECTED pin before it reaches the warning
// (a guaranteed-reachable raw-to-TTY sink — the dispatch step runs with no
// `2>` redirect). Built from the same MODEL_ID_CHARSET_BODY as the accept
// regex above, so every character the matcher accepts also survives the
// sanitizer unchanged, and a widened charset can never diverge from its
// rendering again.
//
// This `g`-flagged instance is for internal `.replace()` use ONLY — a
// `/g` regex is stateful (`.lastIndex` persists across calls) and
// `.test()` on it alternates true/false/true across repeated calls on the
// same string, a false-green trap for any test that reaches for `.test()`
// instead of `.replace()`. To make that trap impossible rather than just
// documenting it, this `g`-flagged object is never exported; the exported
// `MODEL_ID_SANITIZE_STRIP_RE` below is a separate, non-global instance
// built from the same body, safe for `.test()`/`.match()` in tests.
const MODEL_ID_SANITIZE_STRIP_RE_G = new RegExp(`[^${MODEL_ID_CHARSET_BODY}]`, 'g');
// Non-global companion of MODEL_ID_SANITIZE_STRIP_RE_G, exported for
// tests. Do not use with `.replace()` on a value containing more than one
// disallowed character — it only replaces the first match. Production
// code must use the `g`-flagged instance above instead.
const MODEL_ID_SANITIZE_STRIP_RE = new RegExp(`[^${MODEL_ID_CHARSET_BODY}]`);
// A model id has no legitimate reason to be long; this also keeps a
// pathological pin away from the Windows argv ceiling (execFileSync aborts
// if argv > 32,767 chars — CLAUDE.md "Windows ARGV Overflow"). A pin over
// this length is DROPPED WITH A WARNING like every other rejection, never
// truncated into argv — a truncated model id is a different model id.
const MODEL_ID_MAX_LENGTH = 200;
const _dispatchModelPinDropWarned = new Set();
function _warnDispatchModelPinDropped(agentName, rawValue, reason) {
const key = `${agentName}::${rawValue}::${reason}`;
if (_dispatchModelPinDropWarned.has(key)) return;
_dispatchModelPinDropWarned.add(key);
// Sanitize BEFORE truncating: every value that reaches this warning
// failed the model-id charset test by definition (or, for the
// over-length case, still only ever contains charset-legal bytes) —
// sanitizing first catches raw control/escape bytes (ESC, BEL, CSI
// sequences) using the identity-sanitizing pattern already used for
// --as at gsd-tools.cjs:1526. Sanitizing before truncating also ensures
// a truncated escape sequence can never survive (e.g. an SGR sequence
// cut before its reset, leaving sticky terminal state) — truncation
// only ever cuts already-safe characters.
const sanitized = String(rawValue).replace(MODEL_ID_SANITIZE_STRIP_RE_G, '?');
const safe = sanitized.length > 64 ? `${sanitized.slice(0, 64)}…` : sanitized;
process.stderr.write(
`gsd: warning — dispatch model pin for agent "${agentName}" (value "${safe}") ${reason}; ` +
`dropping it so the spawned executor falls back to the session model.\n`,
);
}
// A value starting with '-' (or '--') is a flag/option shape, not a model
// id — `-c`, `--config`, `-`, `--`, `-p` are unsafe to hand to
// resolveOrchestratorExec, whose own `unsafe_leading_dash_model` guard
// rejects them and fails the WHOLE resolution to `{ ok: false }` ->
// exec:null -> a FATAL wave abort (executor-isolation-dispatch.md:299-303),
// even on hosts (e.g. kimi-code) that declare no modelFlag at all and
// previously ignored the pin entirely. This check MUST run BEFORE
// MODEL_ID_CHARSET_RE below: the charset is anchored to `[A-Za-z0-9]` at
// the first character, so every dash-leading value already fails the
// charset test and would otherwise be swallowed by the generic "unsafe
// characters" message, losing the more specific and more actionable
// flag/option diagnosis. Reject here, at the VALUE-policy layer, so a
// leading-dash value degrades to "no model" like every other rejected
// shape, instead of reaching a resolver whose failure mode is fatal
// rather than a graceful drop.
const LEADING_DASH_RE = /^-/;
/**
* Resolve the VALUE policy for an explicit dispatch model pin. `rawValue`
* is whatever resolveAgentModelOverride(..., null) returned — a string
* pin, the 'inherit' sentinel, or null/''/undefined for "no explicit pin".
* Returns the trimmed model string to embed, or `undefined` to emit no
* --model flag at all. Never throws; never fails closed to an error —
* every rejection degrades to "no model" (drop-and-warn), matching the
* documented desired behavior of falling back to the session model rather
* than aborting the wave.
*/
function resolveDispatchModelPin(agentName, rawValue) {
if (typeof rawValue !== 'string') return undefined; // not a string -> no model
const trimmed = rawValue.trim();
if (trimmed === '') return undefined; // whitespace-only -> no model, no warning (#3241)
if (trimmed.toLowerCase() === 'inherit') return undefined; // sentinel -> no model, no warning
const { isAnthropicFlavoredModel } = require('./lib/model-catalog.cjs');
if (isAnthropicFlavoredModel(trimmed)) {
_warnDispatchModelPinDropped(agentName, rawValue, 'is an Anthropic-flavored model/alias, not a valid Codex model');
return undefined;
}
if (LEADING_DASH_RE.test(trimmed)) {
_warnDispatchModelPinDropped(agentName, rawValue, 'looks like a flag/option, not a model id (leading "-")');
return undefined;
}
if (!MODEL_ID_CHARSET_RE.test(trimmed)) {
_warnDispatchModelPinDropped(agentName, rawValue, 'does not look like a model id (unsafe characters)');
return undefined;
}
if (trimmed.length > MODEL_ID_MAX_LENGTH) {
_warnDispatchModelPinDropped(agentName, rawValue, `exceeds the maximum model id length (${MODEL_ID_MAX_LENGTH} characters)`);
return undefined;
}
return trimmed;
}
const DISPATCH_ISOLATION_VOCABULARY = new Set(['harness-worktree', 'orchestrator-worktree', 'none']);
/**
@@ -1841,14 +1990,67 @@ function dispatchOverlayCapabilityCommand({ command, args, cwd, raw, error, load
const promptIdx = args.indexOf('--prompt');
const promptArg = promptIdx !== -1 ? args[promptIdx + 1] : undefined;
const hostIntegration = require('./lib/host-integration.cjs');
// #3714: resolve an EXPLICIT, non-sentinel per-agent model pin for the
// spawned worktree executor. Passing `null` as the runtime resolver
// (3rd arg) is LOAD-BEARING, not an oversight — it is what keeps
// profile/tier-derived models out of argv. Codex's `modelMode: passive`
// posture (ADR-1239) and ADR-2313 forbid GSD driving model selection on
// this host; only an operator's EXPLICIT override may cross this seam.
// resolveAgentModelOverride(..., null) returns a value ONLY when the
// operator pinned one explicitly (measured: unpinned -> null,
// "inherit" -> "inherit" meaning "use the ambient session model, don't
// pass a flag", "" -> null, profile-only -> null). Do NOT swap in
// resolve-model / a full model-resolver here: that resolver falls back
// to a default (e.g. "sonnet") for the unpinned/profile-only cases,
// and emitting that on Codex's exec argv is exactly the documented
// #2310/#2311 regression (a model unknown to Codex forced into a
// passive-posture host).
//
// Presence of a pin is necessary but not sufficient: resolveDispatchModelPin
// applies the same VALUE policy the install-side .toml surface already
// applies to this config key (trim / drop-inherit / drop-Anthropic-flavored
// with a warning / drop-non-model-id-charset with a warning) so a global
// Anthropic-flavored default or an injected config value never reaches argv.
//
// This whole VALUE policy — including its warning — is gated on the
// resolved runtime's descriptor actually declaring a non-empty
// `modelFlag`. The policy runs at this host-NEUTRAL site, so a host
// with no modelFlag at all (kimi, kimi-code, opencode) was never
// going to emit a --model regardless of the pin's value; running the
// policy anyway produced a stderr warning claiming "dropping it so
// the spawned executor falls back to the session model" on every
// dispatch for such a host — misleading today, and actively wrong if
// a Claude-capable host ever declares a modelFlag. When the
// descriptor declares no modelFlag, skip the policy entirely: no
// model, no warning, argv byte-identical to before this pin policy
// existed.
const declaresModelFlag = typeof runtimeEntry?.runtime?.orchestratorExec?.modelFlag === 'string' &&
runtimeEntry.runtime.orchestratorExec.modelFlag.length > 0;
let model;
if (declaresModelFlag) {
const { readGsdEffectiveModelOverrides, resolveAgentModelOverride } =
require('./lib/install-model-override-resolver.cjs');
const pinned = resolveAgentModelOverride(
'gsd-executor', readGsdEffectiveModelOverrides(cwd), null);
model = resolveDispatchModelPin('gsd-executor', pinned);
}
const resolution = hostIntegration.resolveOrchestratorExec(
runtimeEntry?.runtime?.orchestratorExec,
cwdTarget,
promptArg,
model,
);
// A host declaring orchestrator-worktree whose exec descriptor does
// not resolve cannot be spawned — degrade to sequential rather than
// hand the scheduler an unusable command.
// A host declaring orchestrator-worktree whose exec descriptor does not
// resolve halts THIS wave's dispatch: isolation is forced to 'none' here,
// and executor-isolation-dispatch.md:299-303 treats a null exec as FATAL
// (exit 1) after the worktree has already been created — it does not
// degrade to sequential execution. resolveDispatchModelPin rejects any
// leading-dash value (flag/option shape) before it ever reaches this
// resolver specifically so it cannot trip the resolver's own
// `unsafe_leading_dash_model` guard and turn a bad config value into
// this fatal path; every other unresolvable model value likewise
// degrades to "no --model" (session model fallback) rather than to
// resolution.ok === false.
if (resolution.ok) {
exec = { command: resolution.command, args: resolution.args, cwd: resolution.cwd };
} else {
@@ -4434,5 +4636,21 @@ module.exports = {
// #3275: exported for tests — the shared PATH+PATHEXT resolver behind
// review-lane invoke's `deps.spawn` / `deps.hasBinary` seams.
resolveSpawnBinary,
// #3714 follow-up: exported for tests — the dispatch model-pin VALUE
// policy (charset accept/render parity, max-length boundary, leading-char
// anchor) is otherwise unreachable from outside the dispatchOverlayCapabilityCommand closure.
resolveDispatchModelPin,
MODEL_ID_CHARSET_RE,
// The shared character-class body both MODEL_ID_CHARSET_RE and
// MODEL_ID_SANITIZE_STRIP_RE are derived from — exported so a test can
// assert its own expected charset literal EQUALS this value, making a
// silent widening of the production body fail the test instead of only
// the (unexported) regexes built from it.
MODEL_ID_CHARSET_BODY,
// Non-global companion of the internal g-flagged sanitize regex — see the
// comment at its definition for why the g-flagged instance is never
// exported.
MODEL_ID_SANITIZE_STRIP_RE,
MODEL_ID_MAX_LENGTH,
};

View File

@@ -1162,7 +1162,8 @@ const capabilities = {
"exec"
],
"cwdFlag": "--cd",
"promptFlag": null
"promptFlag": null,
"modelFlag": "--model"
},
"hostBehaviors": {
"reapplyCommand": "$gsd-update --reapply",
@@ -5984,7 +5985,8 @@ const runtimes = {
"exec"
],
"cwdFlag": "--cd",
"promptFlag": null
"promptFlag": null,
"modelFlag": "--model"
},
"hostBehaviors": {
"reapplyCommand": "$gsd-update --reapply",

View File

@@ -1588,6 +1588,16 @@ function validateRuntimeBody(cap) {
'runtime.orchestratorExec.promptFlag must be a string or null (got: ' + JSON.stringify(oe.promptFlag) + ')',
);
}
// modelFlag — optional; string or null (#3714). `null`/absent means the
// host offers no per-invocation model override on this exec path; a
// string names the flag that pins the executor's model (codex: --model).
// Deliberately asymmetric: only codex declares this today.
if (oe.modelFlag !== undefined && oe.modelFlag !== null && typeof oe.modelFlag !== 'string') {
errors.push(
'runtime.orchestratorExec.modelFlag must be a string or null (got: ' + JSON.stringify(oe.modelFlag) + ')',
);
}
}
}