Repository navigation
fix: wait for child admission before Stop assertions - #149998
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 16, 2026, 7:52 AM ET / 11:52 UTC (Revision 2). ClawSweeper reviewWhat this changesThe Gateway Stop regression test waits for the matching child’s completion observer before asserting cancellation, and releases that barrier during test cancellation. Merge readiness✅ Ready for maintainer review Keep open: this remains a useful, focused test repair absent from the reviewed main revision. No actionable correctness findings remain, and the maintainer-protected PR is not a cleanup candidate. Priority: P3 Review scores
Verification
How this fits togetherThe Gateway tracks agent execution and completion while subagent registration starts a completion observer. This test checks that stopping a parent cancels its child and preserves the stopped outcome across retries and Gateway restarts. flowchart TD
A[Parent and child execution] --> B[Register child]
B --> C[Real completion observer]
C --> D[Test admission barrier]
D --> E[Stop parent]
E --> F[Check cancellation and restart receipts]
G[Test cancellation] --> H[Release barrier and join producers]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +16. Total +16 across 1 file. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep the real child and completion observer, synchronize Stop with the matching observer’s admission, and retain all durable cancellation and restart assertions. Do we have a high-confidence way to reproduce the issue? No independently verified deterministic reproduction was run. Source supports the timing-sensitive global-poll failure, and the PR reports a failing original-order main run followed by 21 passing cases. Is this the best way to solve the issue? Yes. Observing the existing wait for the exact descendant preserves real execution and cancellation while avoiding a global polling deadline and unrelated work-holder matches. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 809c4dfc1519. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
Await the matching descendant wait through its existing API, retaining the real child producer and all cancellation and restart assertions. Release the barrier on test cancellation and restore observation before producer cleanup.
2b41692 to
df55db4
Compare
|
Merged via squash.
|
Await the matching descendant wait through its existing API, retaining the real child producer and all cancellation and restart assertions. Release the barrier on test cancellation and restore observation before producer cleanup.
Related: #149124, #149853, #149971
What Problem This Solves
The Stop/restart regression can fail before Stop when the child's completion wait starts after its global polling deadline.
User Impact
CI exercises the real child cancellation after the matching completion observation is admitted. The existing abort-signal, terminal outcome, tombstone, retry, restart, and command-count assertions remain.
Why This Change Was Made
Observe the existing agent-job wait for the exact descendant and return its original promise unchanged. Wait for that admission signal before Stop, release the barrier on test cancellation, and restore the observation during owned cleanup.
This preserves the real child producer already on main. It adds no production seam or manually published terminal outcome.
Evidence
a5c1e4440840, the complete file passed 20 cases and failed this case before Stop: both producers were live, but the global wait poll expired.fs-safe 0.12.0, Node 24.21.0). Cold and warm run durations are not treated as a performance comparison.df55db43bcaa.