Skip to content

test(e2e): fake Codex answers the --no-daemon --help probe without a spawn - #24440

Merged
brennanb2025 merged 3 commits into
mainfrom
brennanb2025/e2e-fake-codex-help-probe
Oct 1, 2026
Merged

brennanb2025 merged 3 commits into
mainfrom
brennanb2025/e2e-fake-codex-help-probe

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 7 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​28 $\color{#cf222e}{\Huge{\mathbf{−}}}$​31 $\color{#cf222e}{\Huge{\mathbf{−}}}$​3
Prod 0 0 0 0

ELI5

Some E2E tests launch a fake Codex program and count how many times it starts. Orca now asks Codex --help once before each launch, to check a feature, and the fake counted that question as a second start. This makes every fake Codex answer the question without counting it.

What Changed

Test-only; users see no difference.

  • New tests/e2e/helpers/fake-codex-launch-probes.ts exports FAKE_CODEX_LAUNCH_PROBES_SOURCE. It refuses codex app-server, as every fake already did inline, and answers codex --help with exit 0 and a usage line that doesn't mention --no-daemon.
  • All six fake Codex scripts interpolate that snippet instead of their inline app-server blocks: live-background-terminal-mount-authority, orchestration-legacy-worker-restart-recovery, orchestration-legacy-worker-missing-terminal-recovery, orchestration-worker-terminal-visibility, orchestration-worker-settlement-release-cli, and helpers/completed-worker-retirement-fixture.

Why

Since #23933, before launching a Codex binary named by an absolute path, Orca runs <path> --help to learn whether it supports --no-daemon (src/main/pty/codex-no-daemon-launch-command.ts). The fakes didn't handle --help. They wrote a "spawn" entry, printed their ready banner, and sat until the 5 s probe timeout. Tests that expect exactly one spawn then failed:

Expected length: 1   Received length: 2
[{"argv":["--help"],"event":"spawn",...}, {"argv":["--dangerously-bypass-approvals-and-sandbox"],...}]

live-background-terminal-mount-authority and orchestration-legacy-worker-restart-recovery fail this way every night (10-01 run). #24033 already fixed the same thing in one fixture with an inline guard. This PR puts that guard in one place so the remaining fakes, and new ones, can't drift. The three fakes that weren't failing today have the same gap, and their worker tests appeared in earlier nightly reds.

The help text deliberately omits --no-daemon, so Orca keeps launching the fakes with unchanged arguments. That keeps the tests' argv assertions valid, same as #24033. Skipping the probe under E2E was the other option, but the probe is real launch behavior; the fakes should model a real Codex.

A second stale assertion this exposes. The "current worker" case of orchestration-legacy-worker-restart-recovery used to fail at the spawn count before reaching its last check. That check expects the dispatch row's capability_hash to be a string, but #23994 stopped minting the per-dispatch capability token, so the column is now null. #23994's own rule is that tests assert dispatch state, not the capability column, so this PR drops capability_hash from that query and its expectation.

Moving the guard into the helper also keeps live-background-terminal-mount-authority.spec.ts under the 800-line lint limit; an inline copy pushed it to 803.

Testing

  • Targeted E2E dispatch for all seven specs that use these fakes: 36909447979: 9 of 10 pass, including both restart-recovery cases and every other worker spec.

  • Still red, not caused or fixed here: live-background-terminal-mount-authority now gets past the spawn count, then fails its main check: on first mount, the three background terminals should be adopted into their tabs without duplicates. This run got terminal_surface_ownership_unavailable; the PR-check run got the same terminal adopted into extra tabs. The same check failed on the 09-28 and 09-29 nightlies (line 659), before fix(terminal): run Orca's cmd.exe, path-named and setup-gated Codex launches without the shared server #23933 added the --help check, so it is an older, separate problem that the --help failure had been hiding. It passed once, in a combined run on an older main, so it is intermittent. It needs its own investigation.

  • Ran the snippet directly under Node: --help exits 0 with the usage line, app-server exits 2 with the refusal, and a normal launch falls through to the fake agent.

  • oxfmt and oxlint are clean on the touched files.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

Linked Issue

N/A (maintainer fix for the red nightly E2E run on main)

Visual Proof

N/A: test-only change, no UI or behavior change.

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Test-only. No SSH, mobile, wire, or cross-version impact.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

…spawn

Since #23933 Orca runs `codex --help` before a path-named Codex launch. The
fakes logged it as an agent spawn and held the probe for its 5 s timeout.
Move the app-server refusal and --help answer into one shared
FAKE_CODEX_LAUNCH_PROBES_SOURCE used by every fake Codex.
…rker no longer has

#23994 stopped minting the per-dispatch capability, so capability_hash is null.
The --help spawn failure used to stop this test before it got here.

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes

Test-only E2E fixture fix. Nothing here changes production behavior; the PR makes the fake Codex binaries answer the --help support probe that planCodexNoDaemonLaunch runs before an absolute-path launch, so a spec that asserts exactly one spawn no longer sees the probe recorded as a second one.

  • Shared probe snippet — new tests/e2e/helpers/fake-codex-launch-probes.ts refuses app-server (exit 2) and answers --help with exit 0 and a usage line that omits --no-daemon, keeping the fakes' launch argv unchanged.
  • Six fakes wired to the helper — live-background-terminal-mount-authority, orchestration-legacy-worker-restart-recovery, orchestration-legacy-worker-missing-terminal-recovery, orchestration-worker-terminal-visibility, orchestration-worker-settlement-release-cli, and helpers/completed-worker-retirement-fixture all replace their inline app-server block with the interpolation.
  • Capability-column assertion dropped — assertDispatchRemainsCurrent no longer selects or expects capability_hash, consistent with the local-dispatch-null behavior after #23994 and with markAssignmentAsPreUpdateLegacy in the same file.

I verified the snippet's behavior directly (--help → exit 0 with no --no-daemon; app-server → exit 2; a normal invocation falls through), confirmed every fake that records spawn events is covered while the two absolute-codex fakes that don't assert spawn counts are correctly left alone, and confirmed oxlint is clean on the touched files. The one uncovered edge is the --no-daemon-supported branch (all fakes omit the flag), which is the pre-existing, deliberate #24033 choice rather than something this PR introduces.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@greptile-apps

greptile-apps Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Low risk] Refactors test helper code for end-to-end tests.

The PR appears safe to merge with respect to the changes reviewed.

Summary

The PR moves fake Codex launch-probe responses into a shared test helper and updates six fixtures to use it. It also removes a stale capability-column assertion from the restart-recovery test. Since the previous review, the branch only merged main; no PR-file changes introduced a new finding.

Reviews (2) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..."

@coderabbitai

coderabbitai Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: b6660c97-f2bd-4a8e-b189-811eb43b26e7

📥 Commits

Reviewing files that changed from the base of the PR and between ae480fe and ea742e1.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: e524550c-dc9d-4e4d-a011-3f4a875319aa

📥 Commits

Reviewing files that changed from the base of the PR and between 198fe72 and ae480fe.

📒 Files selected for processing (7)
  • tests/e2e/helpers/completed-worker-retirement-fixture.ts
  • tests/e2e/helpers/fake-codex-launch-probes.ts
  • tests/e2e/live-background-terminal-mount-authority.spec.ts
  • tests/e2e/orchestration-legacy-worker-missing-terminal-recovery.spec.ts
  • tests/e2e/orchestration-legacy-worker-restart-recovery.spec.ts
  • tests/e2e/orchestration-worker-settlement-release-cli.spec.ts
  • tests/e2e/orchestration-worker-terminal-visibility.spec.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

The e2e fake Codex scripts now use a shared launch-probe source for app-server and --help arguments. The restart-recovery test also removes capability_hash from its dispatch-authority query and expected result.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to ae480

The test-only change standardizes fake Codex launch probes and removes a stale recovery assertion. No actionable merge-blocking risk is established; merge after normal checks, including the targeted E2E run.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 7 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the main change: fake Codex processes the --no-daemon --help probe without creating an extra counted spawn.
Description check ✅ Passed The description is complete and explains the problem, implementation, rationale, testing, known unrelated failure, linked-issue exception for a maintainer fix, and checklist status.
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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.

@brennanb2025
brennanb2025 merged commit 8c1670f into main Oct 1, 2026
39 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

Development

Successfully merging this pull request may close these issues.

1 participant