Skip to content

test(subagents): settle yielded wait continuation - #160987

Closed
giodl73-repo wants to merge 1 commit into
openclaw:mainfrom
giodl73-repo:fix/subagent-registry-yield-test-settlement
Closed

giodl73-repo wants to merge 1 commit into
openclaw:mainfrom
giodl73-repo:fix/subagent-registry-yield-test-settlement

Conversation

@giodl73-repo

@giodl73-repo giodl73-repo commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

The subagent registry suite uses fake timers. Its yielded agent.wait case drained observed root work before advancing the zero-delay continuation, so the unchanged test could leave the run in running state under shard load.

Change

Advance fake timers by zero before draining the owned root-work scope, matching the suite's existing lifecycle-settlement pattern.

Evidence

@clawsweeper

clawsweeper Bot commented Sep 29, 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 agents Agent runtime and tooling size: XS labels Sep 29, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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 29, 2026
@clawsweeper

clawsweeper Bot commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 29, 2026, 1:22 AM ET / 05:22 UTC.

ClawSweeper review

What this changes

Adds a zero-time fake-timer advance to the subagent registry test before it drains tracked completion work, so the collector-yield assertion can observe the settled run.

Merge readiness

⛔ Blocked before merge - 2 items remain

Keep this PR open. Current main still has the test timing gap, and the focused change follows the settlement pattern used by nearby cases. No actionable patch defect was found; repeatability in the original failing shard remains unverified.

Priority: P3
Reviewed head: 5e96502f9081de8a5ef67186a424e34e55bef8fc

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The focused change fits the test's ownership boundary and passed its changed-tests check, with repeatability in the original shard still to document.
Proof confidence 🌊 off-meta tidepool Not applicable: The branch changes test synchronization rather than production behavior; exact-head changed-tests CI passed. The supplied MEMBER status and verified repository maintain permission exempt the contributor real-setup proof gate, while flake repeatability remains a separate validation gap. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The branch changes test synchronization rather than production behavior; exact-head changed-tests CI passed. The supplied MEMBER status and verified repository maintain permission exempt the contributor real-setup proof gate, while flake repeatability remains a separate validation gap. No stored-data contract changes.
Evidence reviewed 8 items Introduced change: The pinned PR delta adds one fake-timer advance before the test drains observed root work; no production file changes.
Current main still needs the change: The same test on fetched main proceeds directly from registration to root-work draining without advancing fake timers.
Settlement boundary: The root-work observer drains operations registered after observation starts. The registry's wait owner processes yielded collector results asynchronously and completes the run through that work.
Findings None None.
Security None None.

How this fits together

The subagent registry records child-agent runs and reconciles results returned by the Gateway's agent.wait operation. This test supplies a yielded wait result and checks that a collector finishes without being treated as cancelled.

flowchart LR
A[Gateway wait result] --> B[Subagent registry]
B --> C{Collector yielded?}
C --> D[Completion work]
E[Fake timer turn] --> D
D --> F[Recorded terminal run]
F --> G[Test assertion]
Loading

Before merge

  • Resolve merge risk (P1) - The supplied after-fix result is a passing changed-tests job, not repeated runs of the original failing shard; stability under that shard's load remains unverified.
  • Complete next step (P2) - Document 20 clean standalone file runs, three runs of the original failing shard, and the owner's sibling tests, with the measured single-worker file wall time and CI seconds.
Agent review details

Security

None.

PR surface

Tests +1. Total +1 across 1 file.

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

Review metrics

None.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep the collector-yield assertion in the registry test and ensure its pending continuation is admitted before the test drains tracked completion work.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep the collector-yield assertion in the registry test and ensure its pending continuation is admitted before the test drains tracked completion work.

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

No high-confidence repeatable reproduction has been demonstrated in this read-only review. The PR reports intermittent failures in a named shard, and current-main source shows the pre-drain timing gap.

Is this the best way to solve the issue?

Yes. Advancing the suite's fake clock before draining observed work matches nearby tests and preserves the existing terminal and no-cancellation assertions.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against e2c8c3f3e7b4.

Labels

Label changes:

  • add P3: This is a focused test-stability change with no demonstrated user-facing runtime regression.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The branch changes test synchronization rather than production behavior; exact-head changed-tests CI passed. The supplied MEMBER status and verified repository maintain permission exempt the contributor real-setup proof gate, while flake repeatability remains a separate validation gap. No stored-data contract changes.

Label justifications:

  • P3: This is a focused test-stability change with no demonstrated user-facing runtime regression.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The branch changes test synchronization rather than production behavior; exact-head changed-tests CI passed. The supplied MEMBER status and verified repository maintain permission exempt the contributor real-setup proof gate, while flake repeatability remains a separate validation gap. No stored-data contract changes.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Mitchell Etzel: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Record the repository-prescribed standalone, original-shard, and sibling-test runs, plus the test file's measured wall time.

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.

steipete added a commit that referenced this pull request Sep 29, 2026
The subagent registry collector-yield case drained owned root work before the
fake-timer zero-delay agent.wait continuation ran, so under shard load the run
could still be running when asserted. It failed twice in checks-node-changed on
#160620 and on #160969 while passing standalone. Advance fake timers by zero
before draining, matching the suite's existing lifecycle-settlement pattern.

Diagnosis and fix from #160987.

Co-authored-by: Gio Della-Libera <[email protected]>
@steipete

Copy link
Copy Markdown
Contributor

Landed on main as 4c61161 with your co-author credit. This was the same one-line fix: advance fake timers by zero before draining owned root work. The case kept failing checks-node-changed on other PRs, so it went in as a direct red-main fix. Thanks for the diagnosis.

@steipete steipete closed this Sep 29, 2026
steipete added a commit that referenced this pull request Sep 29, 2026
…ork (#161038)

Cherry-pick of 4c61161 (#160987) for the 2026.9.7 release batch.

Co-authored-by: Gio Della-Libera <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 30, 2026
The subagent registry collector-yield case drained owned root work before the
fake-timer zero-delay agent.wait continuation ran, so under shard load the run
could still be running when asserted. It failed twice in checks-node-changed on
openclaw#160620 and on openclaw#160969 while passing standalone. Advance fake timers by zero
before draining, matching the suite's existing lifecycle-settlement pattern.

Diagnosis and fix from openclaw#160987.

Co-authored-by: Gio Della-Libera <[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: 🐚 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.

3 participants