Repository navigation
fix(native-chat): show only official model names and require them for worker-start --model - #19682
brennanb2025 wants to merge 11 commits into
Conversation
…rker-start --model The composer echoed any tracked model id verbatim: a fabricated catalog row was appended for ids no list carried (shared snapshot, and the structured-route readers in main for Claude and Codex), so a worker launched with --model claude-opus-5 rendered that string as a model and lost its effort picker. Now no layer fabricates a row. A tracked id outside the discovered and seed lists renders the neutral Model pill, while its effort picker stays available from the catalog's unknown-model options so the running session remains adjustable. Legitimately picked models are unaffected: main already maps the init frame's resolved id (claude-opus-5[1m]) back to the listed opus[1m]. worker-start --model now accepts only ids the agent CLI lists on the executing host, probed through the same discovery the chat picker uses (bounded wait, per-scope cache, seed ids as the fallback), and the rejection names the accepted ids and which list answered.
There was a problem hiding this comment.
ℹ️ No critical issues — one minor inefficiency flagged inline.
Reviewed changes
- Official-only model naming —
withTrackedNativeChatModel,buildNativeChatSessionOptionSnapshot, and the structured Claude/Codex readers stop fabricating a raw-id row for a tracked model no list carries; the pill renders neutral "Model" and effort stays settable via the newresolveCatalogModelOptions. worker-start --modelauthority — newworker-launch-model-authority.tsgates--modelon the executing host's CLI list (live probe with 10s budget → 3-min cache → seed), andresolveWorkerLaunchPreferencesvalidates membership and per-model effort levels with named-accepted-ids errors.- Async propagation —
prepareLocalWorkerStart/prepareFederationAttachmentWorkerStartbecame async to await the authority; placements that create a worktree probe the coordinator's host, federatednew-top-levelvalidates against the seed only.
The display and input sides hang together cleanly, and the effort-menu narrowing in liveWorkerLaunchModelAuthority (intersect CLI-advertised levels with the catalog menu) is well-covered by the new tests.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
| effort: args.effort, | ||
| ...(catalog | ||
| ? { | ||
| authority: await resolveWorkerLaunchModelAuthority({ |
There was a problem hiding this comment.
For agents whose catalog lacks supportsWorkerLaunchPreferences (grok, gemini), this probes the host before resolveWorkerLaunchPreferences throws does not support launch-time model selection, wasting a discovery round trip on a path that immediately rejects. Gate the authority resolution on the same condition resolveWorkerLaunchPreferences enforces (catalog.supportsWorkerLaunchPreferences && catalog.modelApply.launchArgs, see worker-launch-preferences.ts:73) so the probe only runs when the result will be used.
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe change stops session and worker-launch flows from fabricating selectable rows for unlisted models. Catalog options now use shared fallback resolution. Claude and Codex retain unlisted models as current runtime values without offering them as choices. Worker launches validate model identifiers and effort levels against seeded or host CLI-discovered authority. Local and federated worker-start preparation now resolves authority asynchronously. Tests and CLI documentation use official model identifiers and describe the updated validation behavior. Priority: ➖ Normal Merge Risk: 🟡 Moderate · up to This change preserves controls for unlisted running models, but Codex may present an effort option that cannot be applied when fallback catalog data is in use. That inconsistent session behavior should be resolved before merge; worker-start fallback documentation also remains incomplete. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: ad0875f8-1d9e-4c71-a7df-eabfacc5d8f3
📒 Files selected for processing (27)
mobile/src/session/use-mobile-native-chat-session-options.tssrc/cli/specs/orchestration-worker-specs.tssrc/main/claude/claude-structured-session-adapter.test.tssrc/main/claude/claude-structured-session-options.test.tssrc/main/claude/claude-structured-session-options.tssrc/main/codex/codex-structured-session-options.test.tssrc/main/codex/codex-structured-session-options.tssrc/main/runtime/rpc/methods/orchestration/federation/federation.tssrc/main/runtime/rpc/methods/orchestration/worker/composed-workers.test.tssrc/main/runtime/rpc/methods/orchestration/worker/local-worker-start.tssrc/main/runtime/rpc/methods/orchestration/worker/worker-launch-model-authority.test.tssrc/main/runtime/rpc/methods/orchestration/worker/worker-launch-model-authority.tssrc/main/runtime/rpc/methods/orchestration/worker/worker-launch-preferences.test.tssrc/main/runtime/rpc/methods/orchestration/worker/worker-launch-preferences.tssrc/main/runtime/rpc/methods/orchestration/worker/worker-start-validation.tssrc/main/runtime/rpc/methods/orchestration/worker/workers-new-worktree.test.tssrc/renderer/src/components/native-chat/native-chat-pty-session-options.test.tssrc/renderer/src/components/native-chat/native-chat-session-option-apply.tssrc/renderer/src/components/native-chat/native-chat-session-option-labels.test.tssrc/renderer/src/components/native-chat/native-chat-session-option-labels.tssrc/shared/agent-session-option-catalog.tssrc/shared/native-chat-session-option-commands.test.tssrc/shared/native-chat-session-option-commands.tssrc/shared/native-chat-session-option-snapshot.test.tssrc/shared/native-chat-session-option-snapshot.tssrc/shared/structured-agent-session-options.test.tssrc/shared/structured-agent-session-options.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.
| 'Current and existing worktrees never rerun setup; a fresh agent terminal is created unless --terminal is explicit.', | ||
| 'When reusing --terminal, pass --worktree for that terminal; current means the coordinator worktree.', | ||
| '--model supports Claude, Codex, and Cursor opaque provider model ids; --effort requires --model. Neither can combine with --terminal.', | ||
| '--model must be an id the agent CLI itself lists on the executing host (Claude, Codex, and Cursor), such as sonnet or opus[1m]; unknown ids are rejected and the error names the accepted ones. --effort requires --model and must be a level that model lists. Neither can combine with --terminal.', |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Document the seeded catalog fallback.
Line 37 says that every accepted model ID must be listed by the host CLI. Remote new-top-level starts and unavailable discovery instead validate against the seeded catalog. State that host discovery is used when available and that built-in catalog IDs are the fallback accepted set.
Electron visual proof — official model names (@91480bbaa3)Two isolated dev instances, hidden renderers, CDP + Playwright only.
Fixture: an empty local git repo registered through A.
|
| run | outcome | wall time |
|---|---|---|
| cold | exit 1, invalid_argument |
1798 ms |
| warm | exit 1, invalid_argument |
147 ms |
A (accept). Official id launches structured
Same command with --model 'opus[1m]' exits 0:
"state": "ready",
"mode": { "mode": "structured", "preferred": "structured", "reason": "user_default" },
"launch": { "requested": { "agent": "claude", "model": "opus[1m]", "effort": "high" },
"effective": { "agent": "claude", "model": "opus[1m]", "effort": "high" } }That worktree's Claude Chat composer renders the CLI's label for the id, Opus (1M context), with effort High.
B / C. Neutral pill for an unofficial persisted id
Seeded through updateSettings using the persisted PersistedNativeChatSessionOptions shape (flat, defined in src/shared/native-chat-session-options.ts), which is the settings shape rather than the in-memory tracked record:
{ "claude": { "model": "claude-opus-5", "valuesByModel": { "claude-opus-5": { "effort": "high" } } } }Then a new Claude chat opened from the tab strip on each instance.
Before — the composer shows the raw claude-opus-5, and the effort pill is absent entirely:
After — neutral Model pill, and the High effort pill is back:
The recovered effort pill is a bigger win than expected: on the before build the unofficial id suppressed the effort control too.
Dropdown lists official models only, no claude-opus-5:
Pane is genuinely structured, not a PTY:
{ "xterms": 1,
"tabs": [ { "contentType": "terminal", "label": "Terminal 1" },
{ "contentType": "agent-session", "label": "Claude Chat" },
{ "contentType": "agent-session", "label": "Claude Chat" } ] }The single .xterm is Terminal 1. Both chats are agent-session.
Two findings
1. The new source file is binary to git, so its diff is unreviewable.
src/main/runtime/rpc/methods/orchestration/worker/worker-launch-model-authority.ts shows as Bin 0 -> 6495 bytes in git diff --stat, and as - for both counts in --numstat. The file holds one literal NUL byte at offset 4906 (line 141), used as a cache-key delimiter between the agent and the worktree selector.
The delimiter choice is sound, but writing the raw byte into the template literal instead of an escape makes git classify the whole file as binary. Nobody can review this file's diff, and blame and review tooling are blind to it. Replacing the raw byte with the two-character escape sequence yields an identical runtime string and restores the text diff. Worth fixing before merge, since 6.5 kB of new validation logic is currently landing unreviewed.
2. Two dropdown entries are both labeled "Fable".
claude-fable-5-1[1m] and fable both render as Fable, separated only by description text ("Fable 5.1 · Most capable…" versus "Fable 5 - most capable…"). Both are official per the CLI, so this is not a regression introduced here, but the picker gives no way to tell them apart at a glance. Visible in the dropdown screenshot above.
Logs
Console logs across both sessions: no errors or warnings after filtering the known noise. Both dev logs contain only benign, identical entries, a ws-transport port fallback and a cancelled file listing. Nothing attributable to this branch.
Not covered
Only the claude agent, only a local execution host, only an existing worktree (--worktree current). No SSH or remote host, no new-worktree path, no Codex or other agent, and no mid-session model switch.
A literal NUL in the template made git treat the module as binary, hiding 6.5 kB of new validation logic from review. Agent ids never contain a space, so the scope key stays unambiguous.
|
Addressed the binary-file finding from the proof run: |
There was a problem hiding this comment.
ℹ️ No new issues in this incremental commit. The prior review's one open thread (probing the host before
resolveWorkerLaunchPreferencesrejects agents lackingsupportsWorkerLaunchPreferences) is untouched by this commit and remains open.
Reviewed changes
- Cache-key separator, NUL → space —
resolveWorkerLaunchModelAuthoritynow keyscachedByScope/inFlightByScopewith`${agent} ${worktreeSelector}`instead of a NUL-joined scope. This un-hides the module from git's binary-diff heuristic (the literal NUL made the file render as binary, hiding the new validation logic) and is behavior-preserving: everyTuiAgentid is space-free, with multi-word ids hyphenated (claude-agent-teams,qwen-code), so the space delimiter is unambiguous.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
The model authority fell back to Orca's static seed whenever the probe could not answer inside the 10s dispatch budget, then refused anything the seed did not carry. That made a dispatch's verdict a function of probe timing — a cold SSH host refused `--model opus[1m]`, the id the CLI help documents, and the byte-identical retry succeeded once the probe had cached — and it asserted "this model does not exist" from a loss of contact, which inverts the execution-host boundary. The Codex seed says so itself: it is deliberately short and expects unknown ids to pass through. Only a `live` answer may now refuse an id; a seed fallback carries no membership and lets the agent CLI report the error. This also disarms two ways the probe silently fails (a folder workspace, an unknown worktree), which previously surfaced as a model error for a worktree fault. Two more divergences between a cold and a warm dispatch go with it: - Effort is a flag Orca emits, not a host fact, so the catalog decides it on both paths again. The probe reports one generic level list for every Codex model, so narrowing to it refused `--effort ultra` on `gpt-5.6-sol` — which the seed path and the picker both accept. - Membership now runs through the same three-way policy the picker uses (`resolveDiscoveredCatalogModels`), so `worker-start` cannot refuse a seeded id the picker offers in the same session. The probe cache is re-keyed on the executing host (`local` / `wsl:<distro>` / `ssh:<id>`) instead of the calling worktree, so N worktrees on one machine run one probe for one fact, and expired entries are swept rather than retained.
`buildNativeChatSessionOptionSnapshot` short-circuits on an empty model list. That used to be unreachable with a model in play: both producers guaranteed a row for the tracked id — the PTY path fabricated one, and the structured catalog pushed `current.model` in. Withholding unofficial ids removed both guarantees, and `readCodexStructuredSessionOptions` only refuses when there is no current model, so a restored Codex thread whose `model/list` came back empty lost the model pill and the effort pill with it. Fixed at the one consumer rather than at each producer: the list is empty, but a tracked id still names what the session runs, so its options row is drawn from `unknownModelOptions`. The model pill stays neutral and offers nothing, which is the honest reading of an empty list.
A local `--model` dispatch resolved it twice — once to name the host the model probe asks, once to place the worker — and each is a `showTerminal` round trip for the same answer. The probe path now hands the id it already paid for to the placement path, which still resolves it itself when no probe ran.
An empty `models` correctly yields an empty snapshot — that is what an empty catalog means, and other callers rely on it. The reachable defect is narrower: `readCodexStructuredSessionOptions` is the only producer that can return `models: []` beside a truthy `current.model`, because its guard throws only when no model resolves at all and `input.current.model` short-circuits it. A restored thread whose `model/list` came back empty therefore lost the model pill and the effort pill with it. The Codex reader now falls back to the seed for its list, the same floor `readClaudeStructuredSessionOptions` already applies (`discovered.length > 0 ? discovered : seedModels()`). Scoped to the empty-list case so a thread with neither a listed model nor a current one still raises "codex app-server returned no available models" rather than offering five ids the account may not hold. Reverts the earlier change to the shared snapshot function, which widened semantics every caller shares to fix one producer's bug. Also covers the probe mechanisms behind the timing fix, which had no tests: the 10s dispatch budget, the abandoned probe still filling the cache, one in-flight probe shared across racing dispatches, and same-host reuse.
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/cli/specs/orchestration-worker-specs.ts (1)
37-37: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winDocument the seed-authority fallback
When the executing host cannot be listed,
resolveWorkerLaunchModelAuthority()returnssource: 'seed', andresolveWorkerLaunchPreferences()skips model-membership rejection. An unknown--modelID can then reach the agent CLI. Update this note to describe the fallback; onlysource: 'live'rejects unknown IDs and reports accepted IDs.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: d089e337-3f64-4993-b662-359c193fae18
📒 Files selected for processing (15)
src/main/runtime/orca-runtime-git.tssrc/main/runtime/rpc/methods/orchestration/worker/composed-workers.test.tssrc/main/runtime/rpc/methods/orchestration/worker/local-worker-start.tssrc/main/runtime/rpc/methods/orchestration/worker/worker-launch-model-authority.test.tssrc/main/runtime/rpc/methods/orchestration/worker/worker-launch-model-authority.tssrc/main/runtime/rpc/methods/orchestration/worker/worker-launch-preferences.test.tssrc/main/runtime/rpc/methods/orchestration/worker/worker-launch-preferences.tssrc/main/runtime/rpc/methods/orchestration/worker/worker-start-validation.tssrc/main/runtime/runtime-git-command-surface.tssrc/main/runtime/runtime-git-generation-commands.tssrc/renderer/src/components/native-chat/native-chat-session-option-enrichment.tssrc/shared/agent-session-option-catalog.tssrc/shared/native-chat-session-option-snapshot.test.tssrc/shared/native-chat-session-option-snapshot.tssrc/shared/structured-agent-session-options.test.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 3 remain after this review.
There was a problem hiding this comment.
ℹ️ No new issues in this delta — nothing needs to change. I'm not approving only because the prior review's single open
ℹ️thread (the wasted host probe beforeresolveWorkerLaunchPreferencesrejects grok/gemini for lackingsupportsWorkerLaunchPreferences) is untouched by these three commits and stays open for the author.
Reviewed changes
- Reworked the model authority to membership-only —
resolveWorkerLaunchModelAuthoritynow returnsmodelIdsresolved through the sharedresolveDiscoveredCatalogModelspolicy, and aseedfallback (host never listed) no longer refuses an id — only aliveanswer may reject, so loss of contact with a host stops masquerading as "this model does not exist". - Reverted effort validation to the catalog —
resolveWorkerLaunchPreferencesno longer narrows effort to the probe's generic level list (which refused--effort ultraon a warm Codex cache while the cold path and picker accepted it), matchingorigin/mainon both paths. - Re-keyed the probe cache on the executing host — the cache/in-flight maps key on
`${agent} ${hostKey}`instead of the worktree selector, deduping N worktrees on one machine and skipping the probe for selectors this client cannot resolve. - Kept the options row on an empty provider list —
buildNativeChatSessionOptionSnapshotno longer blanks the model and effort pills when a provider lists no models but a model is still tracked. - Resolved the coordinator worktree once per dispatch —
prepareLocalWorkerStartreturns the already-resolvedcallerWorktreeIdsostartLocalWorkerskips a secondshowTerminalround trip.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
ℹ️ No new issues in this incremental commit.
Reviewed changes
- Floored the Codex model list on the seed —
readCodexStructuredSessionOptionsnow returnsseedCodexModels()whenmodel/listanswers empty (mirroring the Claude reader's existingseedModels()fallback), and the shared snapshot's empty-list special case reverts to the simplermodels.length === 0 → []. Both structured readers now floor on a non-empty seed, sobuildNativeChatSessionOptionSnapshotis never handed an empty list alongside a running model — the two new tests pin both the restored-thread-with-empty-list and the neither-model-nor-current throw cases.
The one prior ℹ️ thread remains unchanged by this commit and stays open.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 4f05ad14-7e3c-4928-9546-cb01400242fa
📒 Files selected for processing (6)
src/main/codex/codex-structured-session-options.test.tssrc/main/codex/codex-structured-session-options.tssrc/main/runtime/rpc/methods/orchestration/worker/worker-launch-model-authority.test.tssrc/shared/native-chat-session-option-snapshot.test.tssrc/shared/native-chat-session-option-snapshot.tssrc/shared/structured-agent-session-options.test.ts
💤 Files with no reviewable changes (1)
- src/shared/structured-agent-session-options.test.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 3 remain after this review.
| // The seed is the floor, the same one the Claude reader falls back to. | ||
| return { | ||
| models, | ||
| models: models.length > 0 ? models : seedCodexModels(), |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Keep effort validation compatible with the seeded fallback.
If model/list is empty and current.model is unlisted, this returns seed models but preserves the unlisted current model. The snapshot then shows a settable effort option. On apply, applyValidatedCodexStructuredSessionOption cannot find that current model in catalog.models and rejects every effort value.
Preserve enough fallback authority to validate the resolved effort options for the running model, or mark the effort option as not settable in this state. Add an apply-path test for an empty response and an unlisted current model.
`structuredAgentSessionOptionCatalog` runs on the client, over a result a host of any version published — both `use-structured-agent-session.ts` and mobile's `use-mobile-structured-agent-options.ts` hand it straight off the `agentSession.options` wire. It mapped `result.models` through unchanged, so an empty list reached the snapshot, which correctly returns `[]` for an empty catalog, and the model pill and effort pill both vanished. On `origin/main` that was unreachable: this function unconditionally pushed `current.model`, so the list was never empty. Withholding unofficial ids removed that push, so the exposure is this PR's. Flooring only the host-side readers closes it for new hosts; a new client paired with an older host still hits it, which is the divergence `docs/reference/remote-wire-compatibility.md` covers when a host changes what it publishes. The floor uses `seed.models`, the catalog the client already passes in, so it holds for Claude and any future structured agent rather than one provider. The reader-side floors stay as defence in depth.
Reverts f4a75f6. It guarded a mixed-version pairing that does not exist. Every released host already guarantees a non-empty `models` beside a current model, by the same fabrication this PR removes: `origin/main`'s Codex reader pushes a `{ id: current.model, … }` row whenever the current id is unlisted, and its Claude reader both floors on the seed and pushes. A successful reply from either therefore never carries an empty list. The only builds that could publish one are this PR's own unreleased intermediate commits, which no host runs. So the floor was unreachable, and the wire test standing behind it pinned a payload no host can send — which would read to the next person as evidence that it can. The Codex reader's own floor stays; that one closes a case the provider can genuinely produce.
The `no authority at all` case is not the contract F1 changed: an omitted authority was permissive before and after, so the arm went green under ablation and read as coverage it never provided. In production the authority is always supplied when a model is present — `resolveWorkerLaunchPreferences` returns early otherwise — so the case is reachable only from a test. What discriminates is a seed authority accepting an id it does not carry, which the remaining case asserts. Re-ablated: reinstating seed-path rejection now fails both seed tests instead of one.
There was a problem hiding this comment.
ℹ️ No new issues in this incremental commit. The prior review's open thread — probing the host before
resolveWorkerLaunchPreferencesrejects agents lackingsupportsWorkerLaunchPreferences(grok/gemini) — is untouched by this commit and stays open.
Reviewed changes
- Client-side seed floor in
structuredAgentSessionOptionCatalog— the model list now floors on[...seed.models]when the host published an emptymodelsarray, so a host that predates the readers' own seed floor can no longer blank the model/effort row for a restored thread; the raw-id row factory for an unlistedcurrent.modelis dropped entirely (the record still tracks it asvalueSource: 'unknown'). - Wire-compat test for the empty-list case — a new
it.eachover Codex and Claude asserts the options row survives an empty published list, the pill withholds the raw id, and effort stays settable.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
ℹ️ No new issues in this delta. The prior review's open thread — probing the host before
resolveWorkerLaunchPreferencesrejects agents lackingsupportsWorkerLaunchPreferences(grok/gemini) — remains untouched and stays open.
Reviewed changes
- Reverted the client-side model-list floor —
structuredAgentSessionOptionCatalogis back toresult.models.map(discoveredModel)with no seed floor. The revert is sound: no released host can publishmodels: []beside a truthycurrent.model, sinceorigin/main's readers fabricate a row for an unlisted current id (Claude floors onseedModels(), Codex throws when nothing resolves), and this PR's readers floor on seed host-side. The empty-list seed floor was unreachable defense. - Dropped the non-discriminating test arm — the
authority: undefinedarm of theit.eachaccepted any id with or without the fix (no authority means no rejection), so it was theatre; the survivingSEED_WORKER_LAUNCH_MODEL_AUTHORITYarm still discriminates against seed-path rejection.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
… cannot run The RPC-level worker tests never reach a live authority: their harness builds a runtime with no worktrees, so the host-key lookup throws, is swallowed, and every dispatch takes the seed path. Nothing pinned which worktree the probe is asked about, so a refactor that probed the WORKER'S target instead of the COORDINATOR'S would have stayed green while asking the wrong machine which models exist. Eight unit tests over `prepareLocalWorkerStart` and `prepareFederationAttachmentWorkerStart`, observing the selector at the host-key seam: `current` / `new-child` / `new-top-level` resolve to the coordinator's own `id:<worktreeId>`, an exact selector passes through untouched, no `--model` probes nothing, a federated attachment probes the remote worktree it names, and a federated new-top-level probes nothing because the remote has not made it yet. The host-key catch also swallowed a wiring failure indistinguishably from an unresolvable selector. Only the first makes `--model` validation a permanent no-op, and it is the one that arrives as a TypeError, so it now says so. An unresolvable worktree stays silent: that is ordinary.
Electron UI validation — native chat model picker +
|
--worktree |
result | |
|---|---|---|
| A | real worktree (host listable → live) |
Agent claude does not accept model claude-opus-5. Accepted ids: … — model rejected |
| B | unresolvable selector (→ seed) |
Agent claude model claude-opus-5 does not support effort bogus-effort. — model accepted |
| C | unresolvable selector, valid --effort high |
selector_not_found — model and effort both passed validation; failure is downstream at worktree resolution |
So the seed branch does accept an unofficial id and carry it into the launch plan, and only a live answer refuses. What I did not exercise: probe failure or timeout as the specific cause. Both the Claude and Codex CLIs are installed and listable on this box, and a PATH-shim claude stub was defeated — Orca resolves the probe through a login shell, so the stub was never invoked (its invocation log stayed empty) and the rejection still carried the real CLI list. I am reporting that as COULD NOT EXERCISE rather than inferring it from the branch equivalence.
Separately confirmed, and relevant to "a rejection must never claim a built-in list as authoritative": a Codex rejection listed 13 ids (codex-auto-review, gpt-5.2, … gpt-6-astra, gpt-reserve) — a strict superset of the 5-model built-in seed, i.e. demonstrably the live CLI answer and not the seed being passed off as authoritative.
5. --model opus[1m] --effort high still launches a structured worker — VERIFIED
worker-start returned ok: true with requested == effective (model: "opus[1m]", effort: "high"), and the launched worker's composer reads Opus (1M context) / High (sidebar shows opus[1m]):
Incidental observation (pre-existing, not this PR)
The dropdown renders two entries both labelled "Fable" — fable and claude-fable-5-1[1m]. Both come back from the CLI with displayName: "Fable", so the collision originates upstream and this PR only surfaces it faithfully. It is indistinguishable to a user picking between them; may be worth a follow-up.
Gaps
- No before/after ablation against
main; I validated the fixed behaviour only, and did not re-capture the old raw-id pill. - Dev build over CDP only — a packaged build was not exercised.
- macOS local host only: Windows, Linux, SSH/remote and folder-workspace paths untested, as is the mobile surface.
- Claim 4's probe-failure/timeout cause untested, as detailed above.
`worker-start` rejected any id outside the live list for every agent, which contradicts what the catalogs say about themselves. The Codex seed is explicit: "Keep this seed short and allow unknown persisted ids to pass through instead of claiming a complete list." The picker merges seed with live for exactly that reason — the account, not the CLI, decides what Codex can run — so refusing against that list turns away models the account may genuinely hold, and makes the accept/reject outcome, not just the wording, depend on probe timing. Rejection is now gated on whether discovery REPLACES the seed. Claude's CLI publishes its whole list, so `claude-opus-5` stays refused, which is the point of this PR. Grok's catalog declares its discovery authoritative, so it would too. Codex, Gemini and Cursor defer to the agent CLI's own error. `discoveredModelsReplaceSeed` is the single place that knows, and both the picker's merge and the reject gate read it, so the offered and accepted sets cannot drift. An agent that only extends is not probed at all: nothing would be done with the answer. CLI help said `--model` must be an id the CLI lists for Claude, Codex and Cursor. It now says which agents enforce and which pass the id through.
Review status — ready to merge at
|
There was a problem hiding this comment.
ℹ️ No new issues in this incremental commit. The prior review's single open
ℹ️thread — probing the host beforeresolveWorkerLaunchPreferencesrejects agents lackingsupportsWorkerLaunchPreferences(grok/gemini) — is untouched by this commit and stays open.
Reviewed changes
- Placement → probe-selector coverage — new
worker-start-validation.test.tspins, at the host-key seam, which worktree the model probe is asked about:current/new-child/new-top-levelresolve to the coordinator's ownid:<worktreeId>, an exact selector passes through untouched, no--modelprobes nothing, a federated attachment probes the remote worktree it names, and a federated new-top-level probes nothing. - Host-key failure taxonomy —
resolveWorkerLaunchModelAuthoritynow distinguishes the two failures its host-key lookup can produce: aTypeError(a runtime that no longer carriesresolveRuntimeCommitMessageDiscoveryHostKey, which would silently no-op--modelforever) logs, while an unresolvable selector stays silent as ordinary.
Both changes are coverage or diagnostics only; no control-flow change. The TypeError heuristic is sound — resolveWorktreeSelector throws only plain Errors (selector_not_found, selector_ambiguous, worktree_execution_host_unresolved), so the sole TypeError source is the missing-method wiring gap this commit intends to surface.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
ℹ️ No new issues in this incremental commit. The prior review's single open
ℹ️thread — probing the host beforeresolveWorkerLaunchPreferencesrejects an agent that lackssupportsWorkerLaunchPreferences— is partially addressed here (Gemini now skips the probe) but remains open for Grok, which is still probed (see body). Not resolved; not re-raised inline.
Reviewed changes
- Complete-list-only rejection — new
discoveredModelsReplaceSeed(agent, catalog)inagent-session-option-catalog.tsbecomes the single place that decides whether a host's probe answer replaces the seed's membership (Claude, ordiscoveredModelsAreAuthoritative) or merely extends it (Codex, Cursor, Gemini). Both the picker's merge (resolveDiscoveredCatalogModels) and the reject gate read it, so offered ↔ accepted sets cannot drift. - No probe for merge-only agents —
resolveWorkerLaunchModelAuthoritynow returnsseedimmediately whendiscoveredModelsReplaceSeedis false, so Codex/Cursor/Gemini are never asked and never refuse; their id goes through to the agent CLI. - Faithful picker refactor —
resolveDiscoveredCatalogModelsis rewritten over the same predicate and is behavior-identical to the inline ternary it replaced (Claude →[...discovered]; authoritative →mergeDiscoveredAuthoritativeModels; otherwisemergeCatalogModels). - Help text —
orchestration-worker-specs.tsnow names which agents enforce (Claude) and which defer (Codex, Cursor).
This is a real correctness improvement over the previous commit, which rejected Codex/Cursor ids against an account-shaped, incomplete list and so could turn away models the account genuinely holds depending on probe timing. Tests are discriminating (the new refuses ... and not for the one that extends it pins both halves), and the ablation in the PR body covers both forced-true and forced-false of discoveredModelsReplaceSeed.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
Parking this in favour of a smaller PR: #19791Holding this rather than merging it. The display half of this PR withholds the model name — when the tracked id isn't in the official list it sets The requirement is the opposite: the composer should show the model that is actually running. So this isn't a scope trim — it reverses one of this PR's display decisions, which is awkward to do inside a PR whose main body is the validation subsystem. #19791 does the narrow version against
This PR is not wastedIt's in good shape and the work stands on its own merits for when strict validation is wanted:
Known follow-ups if this is picked back up: the WSL host-key cache can serve a stale list across worktrees in one distro (TTL-bounded); Leaving this open and unmerged. |
|
Superseded by #19937, which ports the validation half onto current Two reasons this branch could not simply be rebased:
What carried over unchanged — this was a good design and the review rounds on it stand:
One addition in #19937: Also worth recording from work done on this branch: a session started on an unlisted model is inert, not merely mislabelled. Measured against real binaries — Claude returns Closing unmerged. |










ELI5
Native chat only ever shows official model names now. A tracked model id that neither the agent CLI nor Orca's built-in list knows no longer appears in the composer as if it were a model; the pill reads "Model" and the effort picker stays available.
worker-start --modelrefuses an id only where the executing host's list is a complete one — Claude, whose CLI publishes its whole list — naming the accepted ids. Where the list is not complete (Codex and Cursor, whose models depend on the account) or the host could not be listed at all, the id is passed through and the agent CLI reports its own error. A probe that could not run, or a list that was never exhaustive, is not evidence that a model does not exist.Follow-up to #19431, which made structured workers honour
--model; that opened a path for an unofficial id (for exampleclaude-opus-5) to be seeded into a structured session and echoed by the picker.What Changed
Display (shared + renderer + mobile)
withTrackedNativeChatModelno longer fabricates a{ id, label: id, options: [] }row for an id outside the discovered and seed lists; a seed alias the CLI no longer lists still keeps its seed row.buildNativeChatSessionOptionSnapshotemitscurrentValueonly when a listed row backs it and stampsvalueSource: 'unknown'otherwise, so the pill withholds the raw string. NewresolveCatalogModelOptionssupplies the model's own options or the catalog'sunknownModelOptions, so effort stays settable for a session running an unmatched id. Typed/effortunder an unmatched model and the renderer's option apply path route through the same resolver.structuredAgentSessionOptionCatalog,readClaudeStructuredSessionOptions,readCodexStructuredSessionOptions.current.modelstill reports what the session runs. Legitimately picked models are unaffected: main already maps the init frame's resolved id (claude-opus-5[1m]) back to the listedopus[1m], now pinned by a test.readCodexStructuredSessionOptionsfloors its list on the Codex seed whenmodel/listanswers nothing. It is the only producer that can returnmodels: []beside a truthycurrent.model— its guard throws only when no model resolves at all, andinput.current.modelshort-circuits it — so a restored thread whose list came back empty would have lost the model pill and the effort pill with it. Same floorreadClaudeStructuredSessionOptionsalready applies (discovered.length > 0 ? discovered : seedModels()), scoped to the empty-list case so a thread with neither a listed nor a current model still raisescodex app-server returned no available models. The shared snapshot's[]-for-an-empty-catalog semantics are untouched, and no client-side floor is needed: every released host guarantees a non-empty list beside a current model, becauseorigin/main's readers fabricate a row for an unlisted current id — the very fabrication this PR removes.Input contract (main + CLI)
worker-launch-model-authority.ts: the official ids per executing host. Reuses the model probe the chat picker already uses (discoverRuntimeCommitMessageModels, which routes local / WSL / SSH from the worktree selector). Order: 3-minute per-host cache → live probe (10 s dispatch budget, probe keeps running to fill the cache, failures never cached, concurrent dispatches share one in-flight probe) → seed. A probe answer withcatalogOrigin: 'spec'counts as seed.liveanswer may refuse an id. A seed fallback carries no membership at all. Tying rejection to the seed made a dispatch's verdict a function of probe timing — a cold SSH host refused--model opus[1m], the id this PR's own CLI help advertises, and the byte-identical retry succeeded once the probe had cached — and it asserted "this model does not exist" out of a loss of contact, which invertsdocs/reference/ssh-execution-boundary.md. The Codex seed says as much itself: it is deliberately short and expects unknown ids to pass through.discoveredModelsReplaceSeed(agent, catalog)is the single place that decides, and both the picker's merge (resolveDiscoveredCatalogModels) and the reject gate read it, so the offered and accepted sets cannot drift. Claude replaces, soclaude-opus-5stays refused; Grok declares its discovery authoritative, so it would too. Codex, Gemini and Cursor merge seed with live precisely because the live list is known not to be exhaustive —CODEX_SESSION_OPTION_CATALOGsays so of itself — so refusing against it would turn away models the account genuinely holds, and would make the accept/reject outcome (not just the wording) depend on probe timing. Those agents are not probed at all: nothing would be done with the answer.--effort ultraongpt-5.6-solonce the probe had answered, while the same command succeeded cold and in the picker.local/wsl:<distro>/ssh:<connectionId>, via the existingcommit-message-host-keyidentity that main and the renderer's cache of this same fact already use) rather than on the calling worktree, so N worktrees on one machine run one probe for one fact. Expired entries are swept rather than retained. A selector this client cannot resolve to a host skips the probe outright.TypeErrorand is logged, because that one would make--modelvalidation a permanent no-op with nothing to show for it.prepareLocalWorkerStart/prepareFederationAttachmentWorkerStartbecame async to await the authority. Placements that create a worktree probe the coordinator's host, since that is where the worktree is made; a federatednew-top-levelhas no host to probe yet. The coordinator's worktree is now resolved once per dispatch and handed to the placement path instead of costing a secondshowTerminalround trip.Compatibility
modelsis a content change, not a shape change. An old client paired to a new host re-adds the row itself, so it sees today's behaviour; a new client on an old host still receives the fabricated row until the host updates. No capability gate needed.invalid_argument) with a more specific message; no new RPC fields.worker-start --modelis stricter than before only for Claude, and only where that host's CLI answered. Everywhere else — Codex, Cursor, and any host that could not be listed — the accepted set is unchanged fromorigin/main: the id and its effort go to the agent CLI, which reports its own error. Codex model access depends on the account, so nothing this PR does can refuse an id the account holds.origin/mainon both paths.--model <id>; only its naming is withheld. Retiring the value is a settings change left out of scope.Testing
Run at head
66f27e3931.worker-launch-model-authority19,worker-launch-preferences26,worker-start-validation8 (new — the RPC-level worker tests build a runtime with no worktrees, so their host-key lookup throws and every dispatch there takes the seed path; nothing pinned which worktree the probe is asked about),codex-structured-session-options8. Suites: orchestration worker 37 files / 313 tests;src/shared+src/cli+src/main/codex+ orchestration RPC + renderer native-chat — 1161 files / 12459 tests (8 files, 127 tests skipped); mobile (mobile/vitest.config.ts) — 517 files / 4237 tests, 3 skipped. All pass.claude-stream-json-connection.test.tsfails only under a parallel run and passes alone;claude-tui-resume-real-binary.integration.test.tsfails withCommand failed: ps -axo ….git checkout <sha> -- <file>, which discards uncommitted work), green re-observed: seed-path rejection reinstated → 2 red; the seeded model's effort menu replaced by the narrower generic one → 4; live membership taken as the whole list for every agent → 1;catalogOrigin: 'spec'accepted as a live answer → 1; probe cache keyed on the worktree selector instead of the host → 1; the Codex seed floor removed → 1; the dispatch budget removed → 1; the abandoned probe no longer filling the cache → 2; the in-flight probe no longer shared → 2; coordinator placements probing the worker's target selector → 4; the probe running with no--model→ 1; a federated new-top-level probing a worktree the remote has not made → 1; the wiring-failure log removed → 1; the coordinator's worktree resolved twice → 1;discoveredModelsReplaceSeedforced true (today's blanket strictness) → 2; forced false (nothing ever refused) → 16.check:code-quality:changed0 new findings across 31 changed files (native, type-aware, React Doctor);check:max-lines-ratchetOK, no new bypasses;oxlintclean on the changed paths.mock-server-key-pair.test.tsspawns a child that dies withCannot find package 'tsx', which is absent from this worktree'snode_modules. Both the test and its subject are byte-identical toorigin/main.pnpm tcis run separately by the author; it is not run here.Visual Proof
Electron run on two isolated hidden instances (CDP only), this branch vs main at
ba888cdbef: #19682 (comment)Captured before the follow-up commits. All three cases exercise the live-probe path, which is unchanged by them; only the seed-fallback path (where the CLI could not be listed) now behaves differently.
worker-start --model claude-opus-5→invalid_argument, message names the six ids listed by the claude CLI on the executing host; 1.8 s cold, 0.15 s warm from the cache.--model opus[1m] --effort high→ structured worker, composer reads Opus (1M context) / High.claude-opus-5) opening a new Claude chat: on main the pill echoed the raw id and the effort pill was missing; on this branch the pill reads Model, the effort pill High is present, and the dropdown lists only official ids.