Expand description
The runtime flags a pane’s CLI is given, decided in srv.
The runtime menu shows agent:runtime block meta; the process runs on
cmd:args. The frontend keeps the two in step (buildPaneArgs), but
agent.open — MCP OpenAgent, layouts, agent.define + open — builds a
pane without the frontend. It wrote cmd:args from the catalog alone and no
agent:runtime, so the pane’s CLI ran on its own default model (Opus 5.5 /
medium on current CLIs) while the menu fell back to Sonnet / high. A pane
with a session on file spawns eagerly at open, before any message, so
nothing ever corrected it.
docs/retro/RETRO_RESUMED_AGENT_SPAWNS_WITHOUT_RUNTIME_FLAGS_2026_09_30.md,
docs/reports/REPORT_AGENT_RUNTIME_BINDINGS_2026_09_30.md (G3).
Two entry points, one decision, for the two providers whose model the menu wires (Claude, Codex):
seed_launch— a paneagent.openis creating.with_runtime_flags— a pane that already exists, at the moment it spawns. srv never readsagent:runtimeotherwise, and a persistent process never re-readscmd:args, so a pane saved before the fixes (or written by any path that forgets) would run on the CLI default for its whole life. This is the backstop that makes srv authoritative at the one moment it matters.
The defaults are duplicated from the frontend by necessity and pinned to
its by providers/runtime-defaults-consistency.test.ts.
Structs§
- Agent
Runtime Event - The
agentruntimeevent’s payload (mps_events::AgentRuntime). An absent value is omitted, not null; what the CLI reported is sent only while a process runs. - Effective
Runtime - What the running CLI says it is ACTUALLY using, from its
get_settingsanswer (applied): the alias on the command line resolved to a concrete model, and the effort in force.Nonefor a field the CLI reports as null (Haiku has no effort). - Remembered 🔒
- What the user last picked in the Runtime menu for an agent (
last_runtimeondb_agents), already validated. Each setting is optional: only what was picked is here, and the rest keeps coming from the definition. - Seeded
Launch 🔒 - Spawn
Runtime - What an agent process was actually spawned with: the runtime flags in its
final argv. The Runtime menu shows what was REQUESTED (
agent:runtime); this is what the process was GIVEN, so the menu can say when they differ.Nonefor a flag the argv does not carry — the CLI then uses its own default.
Constants§
- CONTROL_
PROTOCOL_ 🔒FLAG - The flag a control-protocol (persistent) agent is launched with; its
presence in the catalog args is what makes
bypassbecomedefault. - DEFAULT_
EFFORT 🔒 DEFAULT_RUNTIME_CONFIG.effortinfrontend/app/view/agent/types.ts.- DEFAULT_
PERMISSION_ 🔒MODE DEFAULT_RUNTIME_CONFIG.permissionModeinfrontend/app/view/agent/types.ts.- EFFORT_
LEVELS 🔒 - OWNED_
FLAGS 🔒 - Flags this module owns. Stripped from the catalog args so a base that ever grows one cannot double it.
- PERMISSION_
MODES 🔒 - SETTINGS_
REQUEST_ PREFIX - Prefix of the
request_idof ourget_settingsrequests, so the answer can be told from the answers to anything else.
Functions§
- agent_
runtime_ event - The
agentruntimeevent for one pane (persisted, so a menu that mounts late still gets the latest).runningisNonewhen no process is alive — then there is nothing for the menu to compare against.effectiveis what the CLI reported using, when it has (seeEffectiveRuntime). - apply_
remembered 🔒 - Lay what the user last picked over the definition, the way the frontend’s
launch does (
resolveLaunchRuntime): the remembered setting beats the definition’s flag for it, and that flag is taken out of the pane’s copy. - apply_
to_ 🔒meta - Write the three keys that must travel together into a new pane’s meta:
cmd:args(what runs),agent:runtime(what the menu shows) andagent:provider_flags(what the frontend’s per-send rebuild reapplies — it starts from the catalog and would drop the definition’s flags on the first send otherwise, #2872). One call, so no caller can write one without the others. - effective_
from_ control_ response - The effective runtime in a
get_settingsanswer, orNonefor any other frame, an error answer (a CLI that has noget_settings) or one withoutapplied. The shape is{type: control_response, response: {subtype: success, request_id, response: {applied: {model, effort, ...}}}}. - flag_
value 🔒 - The value of
--flag valueor--flag=valueinflags, if present; the last one when it repeats. - is_
claude_ 🔒model - Claude model names: the aliases and concrete ids. A pane carried over from
before per-provider models can have one stored for a Codex agent; it must
never reach Codex, which rejects it (frontend
buildRuntimeArgs.tsguards the same way). - model_
takes_ 🔒effort - Whether
--effortis passed formodel. Haiku takes none (the pinned CLI drops it; older CLIs forwarded it and the API answered HTTP 400 on every turn). Matches the model id as well as the alias, case-insensitively — this wasmodel == "haiku", so a concrete Haiku id still got the flag. MirrorsmodelTakesEffortin frontend/app/view/agent/runtime-capabilities.ts. - publish_
agent_ runtime - seed_
launch 🔒 - Build
cmd:argsandagent:runtimefor a freshly opened pane. - settings_
request_ line - The control request asking a running Claude CLI what it is using. Observed on CLI 2.1.285 to be answered straight after spawn, with no account and no message (docs/specs/SPEC_RUNTIME_MENU_REMAINING_GAPS_2026_10_01.md §7.3).
- spawn_
runtime_ from_ args - The runtime flags in
args. The LAST occurrence of a repeated flag wins, which is how the CLI is expected to read them (unverified; it matters only whenprovider_flagsrepeats a flag the runtime already set).--dangerously-skip-permissionsreads asbypass;--permission-mode XasX. - with_
runtime_ 🔒flags argsas stored incmd:args, plus any runtime flag it lacks, taken from the pane’sagent:runtime(or the defaults when it has none).- without_
flags 🔒 flagswithout thenamesflags (and their values),--flag=valuetoo.- without_
owned_ 🔒flags basewithout any ofOWNED_FLAGS(and their values).- without_
permission_ 🔒flags argswithout the permission flags (--permission-mode X,--dangerously-skip-permissions).