Repository navigation
fix: resolve a worker's engine binary from its own provider, not the global default - #20
aaroncoville wants to merge 2 commits into
Conversation
Co-authored-by: wall-sync <wall-sync@users.noreply.github.com>
…global default
A spawn request may name a `provider` without naming a `command`. In that case
buildWorkerLaunch took the command from the app-wide `defaultCommand` — typically
`claude` — and then appended the auto-mode flag belonging to the REQUESTED
provider. The two halves came from different CLIs, so the result was a command
line no binary accepts:
claude --dangerously-bypass-approvals-and-sandbox [--model gpt-5.6-sol]
error: unknown option '--dangerously-bypass-approvals-and-sandbox'
The worker exited 1 within a second of spawning, before it could do anything.
Root cause: the command and the flags were resolved from two different sources.
The auto flag has always been the provider's (`autoModeFlagForProvider`), but the
command rung skipped the provider entirely and fell through to the global
default, so naming a provider changed the flags without changing the binary.
Resolve the command in the same precedence the rest of the request implies:
an explicit `command` first, then the named provider's preset binary, then the
global default. `custom` has no binary of its own, so it keeps falling back to
the configured default. Requests that name no provider are unaffected.
|
Note for review — one file in this diff is not part of the change.
Against the real target it is clean: Exactly one commit, only the intended files, no fork-only files. The PR body above is written to the upstream template and can be reused verbatim when the upstream PR is opened — the only thing it still needs is the terminal captures under |
🚫 This PR is missing its before/after evidenceEvery pull request here has to show its work. Screenshots or a short screen recording, before the change and after it.
How to fix it: edit the description, keep the A bug fix with no visible surface still needs it: show the failing behaviour, then the same steps passing. A terminal recording is fine. Genuinely nothing to show — a CI tweak, a typo, a dependency bump? A maintainer can apply the |
What & why
A spawn request may name a
providerwithout naming acommand. In that case the launchbuilder took the binary from the app-wide
defaultCommand— typicallyclaude— but took theauto-mode flag from the requested provider. The two halves came from different CLIs, so a
codex-provider worker was launched as
claude --dangerously-bypass-approvals-and-sandbox, whichclauderejects as an unknown option; the worker exited 1 within a second of spawning, before itcould do any work.
Root cause: the command and the flags were resolved from two different sources. The auto flag has
always been the provider's, but the command rung skipped the provider entirely and fell through to
the global default — so naming a provider changed the flags without changing the binary.
The fix resolves the command in the precedence the request already implies: an explicit
commandfirst, then the named provider's preset binary, then the global default.
customhas no binary ofits own and keeps falling back to the configured default; requests that name no provider are
unaffected.
Type of change
Evidence
This is a CLI-argv bug with no UI, so the evidence is the resolved argv and the test that pins it,
captured as text.
Before
Spawn request:
{ provider: 'codex' }— nocommand, app defaultclaude, auto mode on.Resolved argv:
The worker exits 1 immediately.
The two new tests run against the unmodified source on
mainfail:After
The same spawn request, with this change applied.
Resolved argv:
The worker boots and runs. The same tests pass:
How I tested it
npm run test:focusedonmain→552 of 552 passing,
npm run typecheck→ 0 errors.npm run typecheck→ 0 errors.npm run test:focused→ 557 of 557 passing, 0 failing (the 5 new tests are the delta;no pre-existing failures on either ref).
npm run build→ succeeds.src/main/workerLaunch.tsandsrc/main/index.tstomainwhile keeping the new tests: 2 of them go red with'claude' !== 'codex'(transcript under Before). Restored, green again.Discord (optional)
Discord:
Checklist
npm run typecheckpasses.npm run test:focusedpasses.npm run buildsucceeds.commented-out code, or unrelated formatting churn in it.
DESIGN.md/tokens.ts— no ad-hoc colors,spacing, or fonts. (No UI in this change.)
ATTRIBUTION.md. (No art in this change.)