Skip to content

improve: avoid a 15-second fixture wait in accepted Stop tests - #189394

Merged
roboclaw-bot merged 2 commits into
mainfrom
test-health/accepted-stop-deadline-tests
Oct 31, 2026
Merged

roboclaw-bot merged 2 commits into
mainfrom
test-health/accepted-stop-deadline-tests

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Collaborator

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 8c81ee18 missed both injections because the replacement was already absent.

Production mutation Frozen base 8c81ee1 Revised candidate
Abort current source after the original cleanup join FAIL PASS FAIL
Abort current source at later queued-drain entry FAIL PASS FAIL

The revised failures report expected true to be false on the retained replacement signal. The original raw-cleanup-join omission also fails base and revised candidate with Stop 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.

  • Three serial revised timing runs pass all 23 cases. Replacement: 0.722 / 0.727 / 0.787s, versus 15.889 / 15.705 / 15.721s on base.
  • Ten additional serial full-file runs pass 23/23 each, with no failed normal runs or retries for green.
  • Focused typecheck, type-aware lint, format, diff, line/budget, assertion, database, timeout and mock-export ratchets pass. Net test LF +11, production 0; ceiling/grants unchanged, with 26,280 LF inherited slack remaining.
  • pr-simplify completed. Fresh isolated Codex P0–P2 autoreview returned machine status scoped-clean, covering the complete candidate and 23 intact target/owner/helper files in one pass. The reviewed source is committed unchanged.

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.

Run Wall s Vitest s Case sum s Import CPU user/sys s Peak RSS KiB
Before 1 103.91 101.07 47.084 3% 196.65 / 34.24 6780880
Before 2 59.27 56.59 46.746 4% 40.44 / 8.77 1249408
Before 3 58.66 56.37 47.347 4% 41.07 / 6.88 1243284
Revised after 1 81.20 74.12 33.168 3% 186.12 / 33.11 7494216
Revised after 2 48.98 46.20 37.922 4% 40.86 / 7.91 1252016
Revised after 3 46.13 43.19 33.383 5% 42.44 / 8.37 1244032

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

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]>
@clawsweeper

clawsweeper Bot commented Oct 31, 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.

@openclaw-barnacle openclaw-barnacle Bot added the agents Agent runtime and tooling label Oct 31, 2026
@roboclaw-bot
roboclaw-bot marked this pull request as ready for review October 31, 2026 12:54
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 31, 2026
@clawsweeper

clawsweeper Bot commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This 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.

  • Before: Stop waits for the replacement, whose cleanup runs only after Stop returns.
  • After: The test finishes the original execution, retires the replacement through its registration, and awaits its settlement before checking Stop.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused, correct fixture repair with passing exact-head CI; behavioral evidence remains in-process test measurements.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored, test-only repair has supplied before/after fixture measurements and a join-removal negative control; it makes no changed production behavior claim requiring a shipped-entry-point demonstration.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: Developers running the accepted Stop suite incur an avoidable fixture drain wait.
Reason: The maintainer-authored direction removes wasted waiting using existing owners while retaining meaningful cancellation coverage.

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
Reviewed head: 8c81ee18a2b0b0749165676c39ca8755f27e6e54

Before merge

None.

Findings

None.

Agent review details

How this fits together

The 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]
Loading

Technical review

Best 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

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Tests +2. Total +2 across 1 file. Added test files: 0.

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

Labels

Label changes:

  • add P3: This is a test-fixture efficiency repair with no production behavior change.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: This is a test-fixture efficiency repair with no production behavior change.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

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]>
@roboclaw-bot
roboclaw-bot merged commit 0855e7d into main Oct 31, 2026
115 checks passed
@roboclaw-bot
roboclaw-bot deleted the test-health/accepted-stop-deadline-tests branch October 31, 2026 13:41
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 1, 2026
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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