Skip to content

fix(test): await native turn admission before interrupting - #155140

Merged
Patrick-Erichsen merged 1 commit into
mainfrom
codex/codex-native-interrupt-admission
Sep 21, 2026
Merged

Patrick-Erichsen merged 1 commit into
mainfrom
codex/codex-native-interrupt-admission

Conversation

@Patrick-Erichsen

@Patrick-Erichsen Patrick-Erichsen commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an intermittent CI failure where the native Codex admission test interrupts a turn before it becomes active.

User Impact

No runtime behavior changes. The test still verifies queued cancellation, saturation, delegated work, and upstream connection limits.

Why This Change Was Made

Native startup prewarming can open a connection before the turn-start notification. The fixture now waits for the matching thread and turn to start before sending its interrupt, retaining the existing cancellation assertions. No sleeps, retries, or timeout changes.

Evidence

  • Before: an ordered real-native probe reproduced the CI error on its first cancellation: upgrade → start response → interrupt → turn/started, then no active turn to interrupt.
  • After: the same probe completed 20 distinct queued cancellations; the original 12-file cohort passed 309 tests (one authenticated live-only test skipped).
  • Independently checked pinned Codex 0.154.0 startup prewarming, turn-start scheduling, and interrupt admission source.
  • Scoped required checks pass, including extension test types and lint in a standalone checkout.
  • Measured cost: ordered before probe 18.475 s wall / 2.234 s test; ordered after probe (20 distinct cancellations) 44.956 s wall / 19.005 s test. Final original 12-file cohort: 96.978 s wall, with the native test at 14.083 s. The original failing CI cohort took 120.24 s; current-head CI remains in progress.
  • Canonical independent review: scoped-clean at P0. Production delta: 0; test delta: +12/−2.

Found while landing plugin install progress, in the failing CI job. The test is unchanged between that branch and main.

Punchcard-Session: coral-lantern-meadow-m8

Punchcard-Session: coral-lantern-meadow-m8
@clawsweeper

clawsweeper Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@Patrick-Erichsen
Patrick-Erichsen marked this pull request as ready for review September 21, 2026 19:51
@Patrick-Erichsen Patrick-Erichsen self-assigned this Sep 21, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 21, 2026
@clawsweeper

clawsweeper Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 21, 2026, 4:11 PM ET / 20:11 UTC (Revision 2).

ClawSweeper review

What this changes

The native Codex cancellation test now waits for the matching turn-start notification before interrupting, preventing premature cancellation attempts.

Merge readiness

✅ Ready for maintainer review

The fix remains useful on current main, and no blocking defect was found. The updated evidence addresses the prior review’s timing request.

Priority: P2
Reviewed head: 4f77b15bf4a6e53fd9f8578271d2d0316b68655e

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused event-ordering repair with relevant native observations, preserved assertions, and the prior timing follow-up addressed.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The recorded native app-server probe exercises queued cancellation through the actual inference relay with a local synthetic provider: the premature interrupt fails before the fix, and 20 distinct cancellations succeed afterward. This supports the test synchronization change without claiming authenticated provider coverage.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The recorded native app-server probe exercises queued cancellation through the actual inference relay with a local synthetic provider: the premature interrupt fails before the fix, and 20 distinct cancellations succeed afterward. This supports the test synchronization change without claiming authenticated provider coverage.
Evidence reviewed 8 items Introduced change and preserved assertions: The pinned introduction delta adds matching thread/turn notification tracking and an event-driven wait. Cancellation status, socket closure, upstream dial count, saturation, and delegated-work assertions remain intact; no sleeps, retries, deadlines, or production code change.
Still necessary on reviewed main: Fetched main still interrupts after observing the socket upgrade without waiting for turn admission. The latest supplied release does not contain this native test path. No merged replacement was established.
Dependency contract applies: The test launches the managed native Codex app server, verifies its version, and consumes turn lifecycle notifications. The runtime pin is 0.154.0, making direct Codex protocol and interrupt-source inspection relevant.
Findings None None.
Security None None.

How this fits together

OpenClaw’s Codex plugin relays native inference requests through a bounded connection queue. This integration test exercises cancellation and progress under saturation using the real native runtime and a local synthetic provider.

flowchart LR
  A[Native integration test] --> B[Codex app server]
  B --> C[Inference relay queue]
  C --> D[Local synthetic provider]
  B --> E[Matching turn-start notification]
  E --> F[Interrupt request]
  F --> G[Cancellation and connection assertions]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +10. Total +10 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 12 2 +10
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 12 2 +10

Review metrics

None.

Technical review

Best possible solution:

Synchronize cancellation with native turn admission while retaining the existing queue, connection-limit, and progress assertions.

Do we have a high-confidence way to reproduce the issue?

Yes: the recorded native event order and pinned dependency source establish how interruption can precede turn admission; this review did not execute a fresh reproduction.

Is this the best way to solve the issue?

Yes: waiting for the matching native lifecycle event repairs the fixture’s ordering assumption without weakening assertions or changing runtime behavior.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 3d4033fbe0ac.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The recorded native app-server probe exercises queued cancellation through the actual inference relay with a local synthetic provider: the premature interrupt fails before the fix, and 20 distinct cancellations succeed afterward. This supports the test synchronization change without claiming authenticated provider coverage.

Label justifications:

  • P2: This is a bounded repair to a demonstrated native integration-test ordering failure without production behavior changes.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The recorded native app-server probe exercises queued cancellation through the actual inference relay with a local synthetic provider: the premature interrupt fails before the fix, and 20 distinct cancellations succeed afterward. This supports the test synchronization change without claiming authenticated provider coverage.
  • proof: sufficient: Contributor real behavior proof is sufficient. The recorded native app-server probe exercises queued cancellation through the actual inference relay with a local synthetic provider: the premature interrupt fails before the fix, and 20 distinct cancellations succeed afterward. This supports the test synchronization change without claiming authenticated provider coverage.

Evidence

What I checked:

  • Introduced change and preserved assertions: The pinned introduction delta adds matching thread/turn notification tracking and an event-driven wait. Cancellation status, socket closure, upstream dial count, saturation, and delegated-work assertions remain intact; no sleeps, retries, deadlines, or production code change. (extensions/codex/src/app-server/inference-proxy.native.test.ts:293, 4f77b15bf4a6)
  • Still necessary on reviewed main: Fetched main still interrupts after observing the socket upgrade without waiting for turn admission. The latest supplied release does not contain this native test path. No merged replacement was established. (extensions/codex/src/app-server/inference-proxy.native.test.ts:342, 3d4033fbe0ac)
  • Dependency contract applies: The test launches the managed native Codex app server, verifies its version, and consumes turn lifecycle notifications. The runtime pin is 0.154.0, making direct Codex protocol and interrupt-source inspection relevant. (extensions/codex/src/app-server/version.ts:5, 4f77b15bf4a6)
  • Pinned native interrupt contract: Personally inspected the sibling checkout at rust-v0.154.0. Its cache origin verifies openai/codex ownership. Non-startup interrupts reject when no active turn exists and the agent is not running; this matches the reported premature-interrupt failure. (codex-rs/app-server/src/request_processors/turn_processor.rs:1593, 6b9826e3aa83)
  • Turn notification and startup prewarming: TurnStarted emits a notification containing thread identity and the active turn’s ID/status. Separately inspected startup prewarming, which spawns WebSocket preparation during session startup; a connection alone therefore does not establish turn admission. (codex-rs/app-server/src/bespoke_event_handling.rs:166, 6b9826e3aa83)
  • Recorded validation and prior review disposition: The supplied body records the failing native event order, 20 successful distinct queued cancellations after the fix, and 309 passing tests in the original cohort with one authenticated test skipped. It now supplies before/after probe wall times, 96.978 seconds cohort wall time, 14.083 seconds native-test time, and 120.24 seconds for the original failing CI cohort. This addresses the retained timing rank-up request at the unchanged reviewed head. Tests were not rerun during this read-only review. (4f77b15bf4a6)

Likely related people:

  • Vincent Koc: Raw commit 1439307 adds extensions/codex/src/app-server/inference-proxy.native.test.ts:344 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 14393070236e; files: extensions/codex/src/app-server/inference-proxy.native.test.ts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-09-21T19:58:07.575Z sha 4f77b15 :: needs changes before merge. :: none

@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Sep 21, 2026
@Patrick-Erichsen
Patrick-Erichsen merged commit a7c27c0 into main Sep 21, 2026
231 of 235 checks passed
@Patrick-Erichsen
Patrick-Erichsen deleted the codex/codex-native-interrupt-admission branch September 21, 2026 20:16
@Patrick-Erichsen

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: codex maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant