Repository navigation
fix(agents): skip Codex's startup update prompt on Orca-driven launches - #33355
Conversation
Codex's "Update available" screen blocks worker-start, automations and continuation handoffs, and Orca's own Enter picks "Update now", which runs `npm install -g @openai/codex` and exits. Launches that Orca types into after start now pass `-c check_for_update_on_startup=false`; it stays out of the resumable launch config, and launches the user types or attends are unchanged. Fixes #15814 Fixes #18153 Co-authored-by: luisgonzaleznf <47302972+luisgonzaleznf@users.noreply.github.com>
Walkthrough
Priority: Severity of issue fixed: Medium Merge Risk:
|
There was a problem hiding this comment.
Actionable comments posted: 1

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
f4821ed1-a33e-4084-8f5b-177c61a35a6f
Files selected for processing: 29-
src/main/automations/headless-automation-agent-launch.test.tssrc/main/automations/headless-automation-agent-launch.tssrc/main/automations/headless-workspace-create.tssrc/main/automations/runtime-automation-service.test.tssrc/main/ipc/pty-agent-pane-launch.test.tssrc/main/ipc/pty/ipc/spawn-agent-launch.tssrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-02.spec.tssrc/main/runtime/rpc/methods/orchestration/federation/federated-worker-agent-launch.test.tssrc/main/runtime/rpc/methods/orchestration/federation/federated-worker-agent-launch.tssrc/main/runtime/rpc/methods/orchestration/worker/composed-workers.test.tssrc/main/runtime/rpc/methods/orchestration/worker/worker-start-launch-executor-parity.test.tssrc/main/runtime/rpc/methods/orchestration/worker/worker-topology.tssrc/main/runtime/rpc/methods/orchestration/worker/worker-worktree-creation.tssrc/main/runtime/runtime-agent-terminal-startup.tssrc/main/runtime/runtime-managed-worktree-create-types.tssrc/main/runtime/runtime-terminal-contracts.tssrc/main/runtime/runtime-worktree-agent-startup.tssrc/main/runtime/terminal/launch/terminal-create-deduplication.tssrc/main/runtime/workspaces/workspace-activation.tssrc/renderer/src/lib/agent-launch-through-host.tssrc/renderer/src/lib/launch-agent-in-new-tab.test.tssrc/renderer/src/lib/launch-agent-new-tab-host-route.tssrc/renderer/src/lib/launch-agent-startup-prompt-plan.tssrc/renderer/src/lib/launch-work-item-direct-agent.tssrc/shared/agent-pane-launch-request.tssrc/shared/agent-startup-plan-inputs.spec.tssrc/shared/agent-startup-plan-inputs.tssrc/shared/tui-agent-launch-command.tssrc/shared/tui-agent-startup.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.
-
| const launchHead = suppressionArgs.length | ||
| ? `${command} ${suppressionArgs.map((arg) => quoteStartupArg(arg, args.shell)).join(' ')}` | ||
| : command |
There was a problem hiding this comment.
Keep startup suppression ahead of conflicting configured arguments.
If Codex’s configured agentArgs include -c check_for_update_on_startup=true, both command paths place those arguments after launchHead. Codex then applies the later override, so its update prompt can still block a worker or consume a submitted handoff. Give the launch-only false override final precedence, including in the session-options override path. Keep it out of commandWithoutSessionOptions. Codex’s CLI collects repeated -c arguments and treats later overrides as higher precedence. (github.com)
ELI5
When Codex starts and sees that a newer version exists, it shows an "Update available" screen before it does anything else. On that screen, Enter means Update now. A person can just pick Skip. But Orca often starts Codex by itself (workers, automations, "Continue in New Session") and then types a prompt in and presses Enter. That Enter either gets stuck behind the screen (
worker-startfails withAgent startup blocked: codex-update-prompt) or picks Update now, which runsnpm install -g @openai/codex, quits Codex, and loses the prompt. We saw this happen on a test host.This PR tells Codex to skip that screen, but only on the launches where Orca is the one typing into Codex. When you type
codexyourself or open a plain Codex tab, you still get the update offer.Root cause (upstream, openai/codex
origin/main970111f6cb)codex-rs/tui/src/lib.rs:1225-1243: when no argv prompt is given, the TUI callsupdate_prompt::run_update_prompt_if_neededbefore the session starts.RunUpdatereturns withupdate_action, the CLI runs the install command and then exits.codex-rs/tui/src/update_prompt.rs:51-60: the screen only shows ifget_upgrade_version_for_popupreturns a version and an update action exists. The npm shim setsCODEX_MANAGED_BY_NPM, so npm installs always have an action.codex-rs/tui/src/updates.rs:152-156:get_upgrade_version_for_popupreturnsNoneright away when!config.check_for_update_on_startup.codex-rs/core/src/config/mod.rs:4268:check_for_update_on_startupis a plainConfigTomlkey (unwrap_or(true)), so-c check_for_update_on_startup=falseoverrides it for this one process.lib.rs:1226: Codex already skips the screen when a prompt rides argv. That is why the failures only hit launches that start clean and get their prompt typed in afterwards (worker preamble, handoff paste,submit-after-ready).What changed
resolveAgentLaunchCommandtakes a newsuppressStartupUpdatePromptflag. For Codex it adds-c check_for_update_on_startup=falseright after the command. Session options already go in the same place. Agents without a startup updater get nothing. Like session options, the args are launch-only: they go into the typed command but not intocommandWithoutSessionOptions/launchConfig, so a later resume does not inherit them.resolveAgentStartupPlanInputscarries the flag through. It is set only where Orca drives the launch:worker-topology.ts), agent-first worktree (worker-worktree-creation.ts), and both federated worker paths.headless-workspace-create.ts) and existing-workspace launch (launchAgentTerminal).planLaunchAgentStartupPromptwhen Orca will paste and submit), the host pane-spawn route (AgentPaneLaunchRequest.suppressStartupUpdatePrompt, same-version window → own main), and work-item direct launches withsubmit-after-ready.TerminalCreateOptions,RuntimeManagedWorktreeCreateArgs(startupSuppressUpdatePrompt),buildStartupForAgent, andlaunchAgentTerminal.Not changed: user-typed commands, plain "+"/quick-launch tabs, draft (unsubmitted) launches, mobile launches, resumes.
Compared with #18156
This replaces #18156 by @luisgonzaleznf (credited as co-author). That PR found the right flag and the launch-only idea, but it only covered continuation. This fix also covers worker-start (#15814) and automations, and it is smaller:
agent.launchRPC field and no change to the launch fingerprint. The host route uses the same-version pane-spawn request instead.mise exec -- codex.#18156 should be closed in favor of this.
How verified
@openai/codex@0.162.1into a temp--prefixwith an isolatedCODEX_HOMEwhoseversion.jsonnames 0.164.0. Nothing was installed globally. Ran in a 120x40 PTY:codexshowedUpdate available … 1. Update now (runs npm install -g @openai/codex) 2. Skip 3. Skip until next version · enter continuecodex -c check_for_update_on_startup=falsewent straight to the normal start screen (sign-in on this isolated home), with no update screen.resolveAgentStartupPlanInputs+buildAgentStartupPlanproduce on this branch through/bin/sh -cagainst 0.162.1. The ordinary plan (codex …) showed the update screen. The worker plan (codex '-c' 'check_for_update_on_startup=false' …) did not. Also checked that current 0.164.0 accepts the override.launchConfigunchanged); runtimecreateTerminalspawn test; pane-spawn route test.launch-agent-in-new-tab) launch paths now pin the flag.pnpm tcandpnpm run check:code-quality:changedpass. Targeted suites (orchestration, automations, pane launch, runtime, new-tab, work-item, shared startup) pass. In the broadsrc/main src/shared src/renderer/src/librun, the only failures are host-environment ones (real-shell/daemon/packaged-CLI and macOS/private/varpath tests). They fail the same way on the base commit.Risk
quoteStartupArgfor the launch shell (POSIX, PowerShell, cmd). Neither arg has shell metacharacters.-cwith this key works on the versions we checked (0.162.1, 0.164.0) and in the repo's 0.150–0.160 PTY fixtures, which already use it.resolveManagedWorktreeCreateStartup/createTerminalpaths.Fixes #15814
Fixes #18153