Skip to content

fix(agents): align requester wake tests with yielded batch scope - #159352

Merged
steipete merged 1 commit into
mainfrom
fix/requester-wake-e2e
Sep 27, 2026
Merged

steipete merged 1 commit into
mainfrom
fix/requester-wake-e2e

Conversation

@steipete

@steipete steipete commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Related: #158642

What Problem This Solves

Fixes two requester-wake E2E failures caused by tests retaining the old requester-wide settlement contract after yielded batches became independent.

User Impact

No runtime behavior changes. The tests now protect independent yielded-batch delivery, live Gateway ownership, and bounded stale settlement within the batch's own descendant tree. No configuration or migration is required.

Why This Change Was Made

Remote adjacent-commit bisection identified d919bfbb4d892ca2ec7ec9fe59f34a172ef91295. Its PR explicitly states that a frozen batch waits only for its own children and descendants; docs/tools/subagents/announce.md documents the same contract. The wake owner passes frozen rootRunIds into settlement and active-work queries (subagent-announce.requester-settle-wake.ts:245). These are stale tests, not a production regression.

The overlapping-turn case now requires alpha's yielded batch to deliver alpha-only findings while beta remains running with delivery pending, then verifies there is still only one wake after beta completes. Exact captured Gateway resolver checks remain while rows own work. After alpha's settlement, the test requires its binding to be released, matching the existing documented lifecycle from #126062; beta's live binding must remain unchanged through reactivation.

The stale-cap fixture formerly put its blocker outside the frozen batch. It now places that blocker beneath the batch child. Every existing deferral-count, deadline, exhaustion-error, non-delivery, and foreign-active-work assertion remains.

The introducing PR did not change this E2E file. The changed-test planner intentionally omits related E2E targets unless the E2E file itself changes (scripts/lib/ci-changed-node-test-plan.mts:1207), explaining the coverage gap. This PR directly changes the file.

Evidence

All test execution used Linux Blacksmith Testboxes through node scripts/crabbox-wrapper.mjs, with pnpm install --frozen-lockfile before testing. No local tests were run.

  • Main 74469f58f38c15d14ee4cddf24a498c6c21821ad: complete requester-wake file 16 passed / 2 failed, reproducing both exact reported assertions.
  • Parent 37469917520b379b8cf231cc2f99424242489151: 9/9 selected cases passed (both failures plus overlapping-turn controls).
  • Introducing d919bfbb4d892ca2ec7ec9fe59f34a172ef91295: 7 passed / 2 failed, with the same two assertions. git bisect start --first-parent <introducing> <parent> -- src/agents/subagents identifies this first bad commit. Both adjacent revisions used independent frozen installs and identical dependency manifests.
  • Final pnpm test src/agents/subagents/registry/subagent-registry.requester-wake.e2e.test.ts --maxWorkers=1: 18/18 passed three consecutive times. Command wall: 486.87s including the fresh runtime build, then 33.39s / 33.88s using that build; Vitest wall 42.99s / 31.73s / 32.21s.
  • Explicit enumeration of all 138 non-live src/agents/subagents/**/*.test.ts files into node scripts/run-vitest.mjs: 2,756 passed, one existing opt-in entry-reload benchmark skipped; 353.06s across six native shards. Includes all five E2E files (151/151). The four credential-dependent live-provider files were not run.
  • Initial node scripts/check-changed.mjs --base 74469f58f38c15d14ee4cddf24a498c6c21821ad completed in 1,586.80s, failing only broad core lint on unchanged src/gateway/session-row-projection.ts and src/state/openclaw-state-worker-runtime.ts (701 counted lines / 700 limit). Both files and lint configs were verified byte-identical to the base, and the exact failures reproduced in a focused remote lint invocation. Open fix(ci): keep untouched line-limit drift from blocking changed checks #158995 owns untouched-file enforcement; no suppression or policy change is included. All preceding guards, typechecks and three Knip scans passed. The post-test working tree also contained unrelated Workboard manifest drift, which expanded that default selection.
  • Final native two-file changed gate passed: node scripts/check-changed.mjs --base origin/main -- src/agents/subagents/registry/subagent-registry.requester-wake.e2e.test.ts src/agents/subagents/registry/subagent-registry.requester-wake-settlement.test-support.ts, through the wrapper's frozen base overlay. Wrapper command phase: 275.65s. It selected only coreTests, passed the agents-other type graph, all guards/ratchets, all three Knip scans, formatting, and scoped lint with zero warnings/errors.
  • Independent Codex autoreview: scoped-clean through P2. git diff --check passed.

Attribution/reproduction lease: tbx_01m3g1jstfrkjyfhzaf8ktwx4w (run). Its provider shut it down during an earlier changed-check attempt; that incomplete gate is not counted. Final proof lease: tbx_01m3g7eqk6m07m39max5nqsbvq (run). Wrapper source verification binds proof to the candidate tree, independently of the hydration workflow's SHA.

A wider bisect probe initially crossed a dependency bump without reinstalling and stopped at a declaration-build error; it was not classified as a bad revision. The fresh adjacent-commit comparison above supplies attribution. No retries, test skips, assertion weakening, or timeout changes were added.

Exact-head CI run 36290149086 is attached and queued; hosted test seconds are pending. Security Review and PR context/evidence checks have passed. Auto-merge is disabled and no merge is requested. Both task leases are completed/stopped. Duplicate-fix searches were refreshed immediately before publication against main 23ad3a56a0b7d732513d49ea62e53a8e90b84337; only existing failure reports matched, and no intervening commit changed the two tests or wake owner.

Published head: f75f2d0197c32b3fa11fc3d2c60d7e317d45be03; tree 2c55e4357656a380b02dfa175305234b6605c64c exactly matches the final verified Testbox source and reviewed patch.

Follow the frozen cohort contract documented in #158642. Assert independent yielded delivery and live Gateway ownership, then release completed bindings. Keep stale settlement budget assertions on an owned descendant.
@clawsweeper

clawsweeper Bot commented Sep 27, 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 27, 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 27, 2026
@clawsweeper

clawsweeper Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 26, 2026, 11:10 PM ET / September 27, 2026, 03:10 UTC (Revision 2).

ClawSweeper review

What this changes

Updates subagent requester-wake integration tests to check independent yielded-batch delivery, Gateway binding cleanup, and stale settlement within the batch’s descendant tree.

Merge readiness

✅ Ready for maintainer review

Current main still has the outdated requester-wide test expectations, while its production wake logic uses frozen batch scope. The proposed correction matches that contract, and this review found no introduced defect.

Priority: P2
Reviewed head: f75f2d0197c32b3fa11fc3d2c60d7e317d45be03

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The focused assertions fit the current contract and have reported before-and-after and sibling-suite validation, with no concrete patch defect found.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: The external-contributor proof gate does not apply to this MEMBER-authored, test-only PR. The body reports before-and-after Testbox runs through the registry and session-yield lifecycle with mocked Gateway dispatch; no stored-data contract changes.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The external-contributor proof gate does not apply to this MEMBER-authored, test-only PR. The body reports before-and-after Testbox runs through the registry and session-yield lifecycle with mocked Gateway dispatch; no stored-data contract changes.
Evidence reviewed 9 items Introduced test assertions: The PR checks that a yielded child wakes independently while the other child is running, and that the completed row releases its Gateway resolver.
Descendant fixture: The stale blocker is now a child of the frozen batch member, so it exercises that batch’s descendant-settlement limit.
Current main production contract: The wake owner passes frozen batch run IDs into its descendant-settlement query.
Findings None None.
Security None None.

How this fits together

When a requester yields, the subagent registry records the children in that batch and waits for their descendants to settle. The wake owner then sends the batch result through the owning Gateway; these tests exercise that lifecycle.

flowchart LR
A[Requester yields] --> B[Frozen child batch]
B --> C[Registry checks descendants]
C --> D{Batch settled?}
D -->|No| E[Wake remains pending]
D -->|Yes| F[Owning Gateway sends wake]
F --> G[Requester receives result]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +13. Total +13 across 2 files.

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

Review metrics

Metric Value Why it matters
Focused test cost 33.39–33.88 s warmed file wall time The PR reports the changed integration suite’s cost, which exceeds the repository’s 30-second explanation threshold.

Technical review

Best possible solution:

Keep owner-boundary coverage for a completed yielded batch waking once while unrelated work remains active, and for a descendant within that batch delaying settlement.

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

Yes. The PR reports two failures from the focused file on a main ancestor, and current main retains the same relevant test and wake-owner code; this review did not execute the test.

Is this the best way to solve the issue?

Yes. The assertions now check the documented frozen-batch boundary and retain coverage for pending sibling work, binding lifetime, and stale descendant settlement.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P2: The PR repairs deterministic requester-wake test failures without changing production behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The external-contributor proof gate does not apply to this MEMBER-authored, test-only PR. The body reports before-and-after Testbox runs through the registry and session-yield lifecycle with mocked Gateway dispatch; no stored-data contract changes.

Evidence

What I checked:

Likely related people:

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

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-27T02:56:50.346Z sha f75f2d0 :: needs maintainer review before merge. :: none

@steipete
steipete marked this pull request as ready for review September 27, 2026 03:00
@steipete
steipete enabled auto-merge (squash) September 27, 2026 03:11
@steipete
steipete merged commit 09b51ff into main Sep 27, 2026
185 checks passed
@steipete
steipete deleted the fix/requester-wake-e2e branch September 27, 2026 03:13
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 27, 2026
…nclaw#159352)

Follow the frozen cohort contract documented in openclaw#158642. Assert independent yielded delivery and live Gateway ownership, then release completed bindings. Keep stale settlement budget assertions on an owned descendant.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling P2 Normal backlog priority with limited blast radius. 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