Repository navigation
improve: avoid a 15-second fixture wait in accepted Stop tests - #189394
Conversation
Retire the unstarted fixture replacement through its registration cleanup after the original execution finishes, and await its real settlement before awaiting Stop. Co-authored-by: steipete <[email protected]>
|
🦞👀 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. What this changesThis PR retires an unstarted replacement fixture before awaiting Stop, avoiding its drain deadline. Example: The accepted Stop test registers a replacement while the original execution is finishing.
Review scores
ProductKind: Test only · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this collaborator-authored PR makes a focused fixture repair, preserves the cancellation checks, and has no actionable correctness findings. Priority: P3 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe subagent cancellation tests compose registry state, Gateway abort registrations, and session-controller settlement to verify that Stop retains exact execution ownership through cleanup. flowchart TD
A[Accepted Stop test] --> B[Original tracked execution]
A --> C[Replacement registration]
B --> D[Original cleanup settles]
D --> E[Replacement registration cleanup]
C --> E
E --> F[Controller settlement receipt]
F --> G[Stop result and no-abort assertions]
Technical reviewBest possible solution: Retain this narrow registration-owned fixture repair and handle the production self-join in its separately tracked work. Do we have a high-confidence way to reproduce the issue? Source establishes the fixture cycle: final Stop draining can select the unstarted replacement, while the base test retires it only after awaiting Stop; no target code was executed during this review. Is this the best way to solve the issue? The patch is the smallest complete fixture repair: retain the registration, finish original work, invoke existing cleanup, await its real receipt, and inspect the exact replacement signal. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 1145114fddb5. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceTests +2. Total +2 across 1 file. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 31, 2026, 9:10 AM ET / 13:10 UTC. |
Retire the fixture replacement only after Stop starts its native settlement wait. Keep registry and retained-signal assertions so early and late wrong-source cancellation remains observable. Co-authored-by: steipete <[email protected]>
|
Merged via squash.
|
…law#189394) * test(subagents): settle accepted Stop replacement fixture Retire the unstarted fixture replacement through its registration cleanup after the original execution finishes, and await its real settlement before awaiting Stop. Co-authored-by: steipete <[email protected]> * test(subagents): keep replacement visible through Stop drain Retire the fixture replacement only after Stop starts its native settlement wait. Keep registry and retained-signal assertions so early and late wrong-source cancellation remains observable. Co-authored-by: steipete <[email protected]> --------- Co-authored-by: steipete <[email protected]>
What Problem This Solves
The accepted Stop replacement test waits out a 15-second drain because its idle replacement fixture is retired only after awaiting Stop.
User Impact
The replacement case avoids a 15-second fixture wait while retaining its cancellation guard. Production behavior is unchanged.
Why This Change Was Made
Keep the replacement registered until Stop selects its real settlement promise and begins the native drain. Then retire the idle fixture through its registration owner and return the unchanged native wait promise. Check the indexed replacement at registration and its retained controller signal after Stop settles. Failure cleanup owns the same handle.
The six-mode accepted-Stop table, real SQLite/controller ownership and full eight-row terminal-cleanup matrix remain intact. All production code and the separate self-disposal-after-turn-completion plateau remain untouched. Refs #189376.
Evidence
The fault injections use the production cancellation primitive on the current RPC source. At each replacement-visible point, the base and revised tests fail after an actual replacement abort. The prior early-cleanup head
8c81ee18missed both injections because the replacement was already absent.The revised failures report
expected true to be falseon the retained replacement signal. The original raw-cleanup-join omission also fails base and revised candidate withStop returned before joining its exact raw execution.Timing clarification: a literal synchronous kill-entry abort targets the original claimed source, because the replacement is registered later. That normal cancellation control passes base, 8c81ee1 and the revised candidate; it cannot prove future replacement safety. The early replacement-abort injection therefore uses the first Stop continuation after the original cleanup join.
The file retains the approximately 15.7-second product self-join tracked in #189376 and real SQLite/controller admission across all cases. Broad exact-head validation belongs to PR CI.
The three-run file-wall median is 59.27 → 48.98s. The first cold builds and the untouched wake-cancellation outlier are retained; no CPU or RSS reduction is claimed.
Three serial before and three revised after measurements
Command:
timeout 900 /usr/bin/time -v pnpm test src/agents/subagents/registry/subagent-control.accepted-stop.test.ts --maxWorkers=1 --reporter=verbose.Same private frozen dependencies, repository runtime, host, temp root and cache. The first before and revised-after runs include worker compilation; all runs are retained. Revised run 2 also has a 5.807s duration in the untouched wake-cancellation row; that outlier was not discarded or attributed to a proven cause. Case sums are verbose case durations, not file wall time. Import percentages are rounded Vitest 5 output; exact import milliseconds were not emitted. Prior CI case sum was 47.723s across 23 cases; exact-head CI 41205475948 completed successfully. The parent completed source review and approved this exact head; normal native security and required-review gates remain mandatory.
Landing verification
The parent-reviewed head 40be97d merged as 0855e7d at 2026-10-31T13:41:49Z after exact-head CI 41205475948 succeeded and normal native security and required-review gates qualified. Selector-skipped rows do not imply platform execution. Native COMPLETE receipt: 80cd1457fff64d3acdb54ac5bf1bae27db080a13.
The landed tree matches replay of the approved patch on its actual parent. Test LF delta is 11 and effective-cap delta is 0; all current-main grants are preserved. The inherited slack delta is -11 under the parent-approved counting policy. No source edit, rebase or push was needed. All timing claims retain the measured bases and limitations stated above; the original source and runtime scopes still apply. No new CI timing claim is made.
Co-authored-by: steipete [email protected]
Work sessions