Skip to content

fix(agents): skip Codex's startup update prompt on Orca-driven launches - #33355

Merged
nwparker merged 2 commits into
mainfrom
nwparker/agint-codex-unattended-update-prompt
Oct 25, 2026
Merged

nwparker merged 2 commits into
mainfrom
nwparker/agint-codex-unattended-update-prompt

Conversation

@nwparker

@nwparker nwparker commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 9 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​92 $\color{#cf222e}{\Huge{\mathbf{−}}}$​4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​88
Prod 21 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​86 $\color{#cf222e}{\Huge{\mathbf{−}}}$​16 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​70

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-start fails with Agent startup blocked: codex-update-prompt) or picks Update now, which runs npm 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 codex yourself or open a plain Codex tab, you still get the update offer.

Root cause (upstream, openai/codex origin/main 970111f6cb)

  • codex-rs/tui/src/lib.rs:1225-1243: when no argv prompt is given, the TUI calls update_prompt::run_update_prompt_if_needed before the session starts. RunUpdate returns with update_action, the CLI runs the install command and then exits.
  • codex-rs/tui/src/update_prompt.rs:51-60: the screen only shows if get_upgrade_version_for_popup returns a version and an update action exists. The npm shim sets CODEX_MANAGED_BY_NPM, so npm installs always have an action.
  • codex-rs/tui/src/updates.rs:152-156: get_upgrade_version_for_popup returns None right away when !config.check_for_update_on_startup.
  • codex-rs/core/src/config/mod.rs:4268: check_for_update_on_startup is a plain ConfigToml key (unwrap_or(true)), so -c check_for_update_on_startup=false overrides it for this one process.
  • Side note, 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

  • resolveAgentLaunchCommand takes a new suppressStartupUpdatePrompt flag. For Codex it adds -c check_for_update_on_startup=false right 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 into commandWithoutSessionOptions/launchConfig, so a later resume does not inherit them.
  • resolveAgentStartupPlanInputs carries the flag through. It is set only where Orca drives the launch:
    • worker-start: existing-worktree terminal (worker-topology.ts), agent-first worktree (worker-worktree-creation.ts), and both federated worker paths.
    • automations: headless agent-first worktree (headless-workspace-create.ts) and existing-workspace launch (launchAgentTerminal).
    • continuation / handoff and other generated prompts that Orca submits after start: the window-built plan (planLaunchAgentStartupPrompt when Orca will paste and submit), the host pane-spawn route (AgentPaneLaunchRequest.suppressStartupUpdatePrompt, same-version window → own main), and work-item direct launches with submit-after-ready.
  • Main-side plumbing: one optional field each on TerminalCreateOptions, RuntimeManagedWorktreeCreateArgs (startupSuppressUpdatePrompt), buildStartupForAgent, and launchAgentTerminal.

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:

  • No new agent.launch RPC field and no change to the launch fingerprint. The host route uses the same-version pane-spawn request instead.
  • No 116-line terminator splicer. The args go right after the command, where session-option flags already go. That gives the same behavior for command overrides like mise exec -- codex.

#18156 should be closed in favor of this.

How verified

  • Real CLI repro (old Codex, isolated): installed @openai/codex@0.162.1 into a temp --prefix with an isolated CODEX_HOME whose version.json names 0.164.0. Nothing was installed globally. Ran in a 120x40 PTY:
    • plain codex showed Update available … 1. Update now (runs npm install -g @openai/codex) 2. Skip 3. Skip until next version · enter continue
    • codex -c check_for_update_on_startup=false went straight to the normal start screen (sign-in on this isolated home), with no update screen.
  • Orca-built commands on the real CLI: ran the exact launch commands that resolveAgentStartupPlanInputs + buildAgentStartupPlan produce on this branch through /bin/sh -c against 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.
  • Tests:
    • New: plan-shape test (Codex only, typed command only, launchConfig unchanged); runtime createTerminal spawn test; pane-spawn route test.
    • Updated: the exact-shape assertions for the worker, federated, automation and continuation (launch-agent-in-new-tab) launch paths now pin the flag.
    • pnpm tc and pnpm run check:code-quality:changed pass. Targeted suites (orchestration, automations, pane launch, runtime, new-tab, work-item, shared startup) pass. In the broad src/main src/shared src/renderer/src/lib run, the only failures are host-environment ones (real-shell/daemon/packaged-CLI and macOS /private/var path tests). They fail the same way on the base commit.

Risk

  • Cross-platform: the args go through quoteStartupArg for the launch shell (POSIX, PowerShell, cmd). Neither arg has shell metacharacters.
  • Remote / mixed versions: SSH and WSL launches build the command on the host that plans it, so the flag travels inside the command string. An older host just keeps showing the prompt, same as today. No RPC contract changed.
  • Old Codex builds: -c with 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.
  • Folder workspaces: these go through the same resolveManagedWorktreeCreateStartup / createTerminal paths.
  • Mobile: no change. Mobile launches are user-driven.
  • Users who start Codex only through Orca workers or automations won't see the update offer there. They still see it on any launch they type or open themselves.

Fixes #15814
Fixes #18153

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>
@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Walkthrough

The change adds a startup update-prompt suppression option to agent startup planning and passes it through selected renderer, runtime, automation, and worker launch paths. When enabled for Codex, command generation adds -c check_for_update_on_startup=false. Tests cover command generation and propagation through pane, terminal, worktree, and worker launch arguments.

Priority: Normal

Severity of issue fixed: Medium

Merge Risk: Low · up to db4f4

Codex launches with a conflicting setting can still show an update prompt and block an Orca-submitted prompt. The PR is mergeable with this bounded risk accepted or corrected.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 15.79% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 19 functions across 29 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely identifies the main change: suppressing Codex's startup update prompt for Orca-driven agent launches.
Description check Passed The description is detailed, on-topic, and explains the user impact, root cause, implementation, scope, testing, risks, and linked issues. Several template sections are omitted or incomplete, includin…
Linked Issues check Passed The PR meets the relevant coding objectives in #15814 and #18153. For worker-start, existing-worktree, agent-first, and federated launches pass suppressStartupUpdatePrompt, and Codex receives `-c ch…
Out of Scope Changes check Passed The changed production files add one launch-only option and carry it through shared startup, runtime, worker, automation, pane, and continuation paths. The changed tests verify those paths. The resolv…
Full details: Description check

Explanation

The description is detailed, on-topic, and explains the user impact, root cause, implementation, scope, testing, risks, and linked issues. Several template sections are omitted or incomplete, including Visual Proof, Review, Agent skill upstream boundary, Notes, and Checklist, but the core required information is present.

Full details: Linked Issues check

Explanation

The PR meets the relevant coding objectives in #15814 and #18153. For worker-start, existing-worktree, agent-first, and federated launches pass suppressStartupUpdatePrompt, and Codex receives -c check_for_update_on_startup=false. For continuation and handoff launches, the flag is set only when Orca submits the generated prompt, including the host pane-spawn route. The flag remains launch-only, so resumable launch configuration is unchanged. Tests cover command shape, runtime spawning, pane spawning, worker paths, automation paths, and continuation paths. The post-interrupt problem in #15814 is a separate problem and is not part of this startup-prompt change.

Full details: Out of Scope Changes check

Explanation

The changed production files add one launch-only option and carry it through shared startup, runtime, worker, automation, pane, and continuation paths. The changed tests verify those paths. The resolver applies suppression only to Codex, and user-driven, draft, plain quick-launch, mobile, and resume behavior remains unchanged. The changes have a direct connection to #15814 and #18153.

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Commits

Reviewing files that changed from the base of the PR and between d58849a and db4f46a.

Files selected for processing: 29
  • src/main/automations/headless-automation-agent-launch.test.ts
  • src/main/automations/headless-automation-agent-launch.ts
  • src/main/automations/headless-workspace-create.ts
  • src/main/automations/runtime-automation-service.test.ts
  • src/main/ipc/pty-agent-pane-launch.test.ts
  • src/main/ipc/pty/ipc/spawn-agent-launch.ts
  • src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-02.spec.ts
  • src/main/runtime/rpc/methods/orchestration/federation/federated-worker-agent-launch.test.ts
  • src/main/runtime/rpc/methods/orchestration/federation/federated-worker-agent-launch.ts
  • src/main/runtime/rpc/methods/orchestration/worker/composed-workers.test.ts
  • src/main/runtime/rpc/methods/orchestration/worker/worker-start-launch-executor-parity.test.ts
  • src/main/runtime/rpc/methods/orchestration/worker/worker-topology.ts
  • src/main/runtime/rpc/methods/orchestration/worker/worker-worktree-creation.ts
  • src/main/runtime/runtime-agent-terminal-startup.ts
  • src/main/runtime/runtime-managed-worktree-create-types.ts
  • src/main/runtime/runtime-terminal-contracts.ts
  • src/main/runtime/runtime-worktree-agent-startup.ts
  • src/main/runtime/terminal/launch/terminal-create-deduplication.ts
  • src/main/runtime/workspaces/workspace-activation.ts
  • src/renderer/src/lib/agent-launch-through-host.ts
  • src/renderer/src/lib/launch-agent-in-new-tab.test.ts
  • src/renderer/src/lib/launch-agent-new-tab-host-route.ts
  • src/renderer/src/lib/launch-agent-startup-prompt-plan.ts
  • src/renderer/src/lib/launch-work-item-direct-agent.ts
  • src/shared/agent-pane-launch-request.ts
  • src/shared/agent-startup-plan-inputs.spec.ts
  • src/shared/agent-startup-plan-inputs.ts
  • src/shared/tui-agent-launch-command.ts
  • src/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.

Comment on lines +51 to +53
const launchHead = suppressionArgs.length
? `${command} ${suppressionArgs.map((arg) => quoteStartupArg(arg, args.shell)).join(' ')}`
: command

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor · Functional Correctness · Quick win

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)

@nwparker
nwparker merged commit 0fa161b into main Oct 25, 2026
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant