Repository navigation
fix(test): widen the subagent registry root-work teardown fence - #155960
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: blocked before merge. Reviewed September 22, 2026, 5:29 PM ET / 21:29 UTC (Revision 2). ClawSweeper reviewWhat this changesThe remaining branch diff increases the shared subagent test cleanup wait from one second to ten seconds. Merge readiness⛔ Blocked before merge - 3 items remain The prior delivery-error masking finding remains unresolved. Current main already contains targeted repairs for the named failing fixtures, so the remaining global timeout increase has not established a distinct safe fix. Priority: P2 Review scores
Verification
How this fits togetherSubagent tests create asynchronous task notifications that can continue after registry events finish. Their cleanup helper joins captured delivery results and checks that background work has stopped before fixtures release temporary stores. flowchart TD
A[Test fixture actions] --> B[Registry events]
B --> C[Background task delivery]
C --> D[Captured delivery results]
B --> E[Cleanup helper]
D --> E
E --> F{Background work stopped}
F --> G[Release fixture stores]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceTests +5. Total +5 across 1 file. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep fixture-owned delivery joins and the existing root guard, repairing only a demonstrated remaining caller that fails to capture its asynchronous work. Do we have a high-confidence way to reproduce the issue? Yes, from source: an uncaptured delivery rejecting between the old and new deadlines releases its root and can satisfy cleanup without propagating the rejection. No runtime reproduction was executed in this read-only review. Is this the best way to solve the issue? No. Waiting longer observes lifetime completion but not delivery results; the existing capture-and-settle contract preserves both and is already used by the merged fixture repairs. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 9eec298184e0. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
…f-leftover # Conflicts: # test/helpers/sqlite-sessions-transcripts-flip-proof.ts
|
Merged via squash.
|
) ## Summary Full Release Validation 35775979903 (CI child 35776854264, candidate `release/2026.9.6` = main `814a7e752afc` + locale refresh + #155892) failed `subagent-registry.persistence.test.ts`, `subagent-spawn.authority.test.ts`, `chat.abort-errors.test.ts` and `chat.abort-incarnation.test.ts` in `settleSubagentRegistryPersistenceWork` with `residual registry roots: tasks:delivery (2|4|6): expected N to be +0`. All were green in the two previous validation runs. Bisected to #151917 (`68b724b355e`, move terminal notification writes off the Gateway thread): `subagent-registry.persistence.test.ts` passes 30/30 at `68b724b355e^` and fails at `68b724b355e` with the exact CI signature; on current main it fails 5/5 locally. The `tasks:delivery` roots are not leaked: with a 20 s fence the same test passes (3.3 s), i.e. uncaptured deliveries settle 1–2 s after the test body, while the shared helper used `vi.waitFor`'s 1 s default. #155910 and #155888 already fixed individual fixtures by capturing deliveries; this widens the shared fence so the remaining callers (persistence, timing, resume, task-replacement, chat.abort-*) stop racing it. Test contract change only; no product change. The related `build-artifacts` failure (`sqlite-sessions-transcripts-flip-proof` rejecting the delete-drain `stopReason`) was fixed on main in parallel by `8ba18cf19ad`; this branch merged that and carries no change of its own for it. ## Change - `src/agents/subagents/registry/subagent-registry.persistence.test-support.ts`: `vi.waitFor(..., { timeout: 10_000 })` in `settleSubagentRegistryPersistenceWork`. ## Proof - The four affected files green in one local vitest run with the change (`Tests 26 passed`, `Tests 36 passed`). - `oxfmt --check` / `oxlint` clean on the changed file; exact-head hosted gates via `scripts/pr`.
…claw#155960) ## Summary Full Release Validation 35775979903 (CI child 35776854264, candidate `release/2026.9.6` = main `4064209d089c` + locale refresh + openclaw#155892) failed `subagent-registry.persistence.test.ts`, `subagent-spawn.authority.test.ts`, `chat.abort-errors.test.ts` and `chat.abort-incarnation.test.ts` in `settleSubagentRegistryPersistenceWork` with `residual registry roots: tasks:delivery (2|4|6): expected N to be +0`. All were green in the two previous validation runs. Bisected to openclaw#151917 (`63729428338`, move terminal notification writes off the Gateway thread): `subagent-registry.persistence.test.ts` passes 30/30 at `63729428338^` and fails at `63729428338` with the exact CI signature; on current main it fails 5/5 locally. The `tasks:delivery` roots are not leaked: with a 20 s fence the same test passes (3.3 s), i.e. uncaptured deliveries settle 1–2 s after the test body, while the shared helper used `vi.waitFor`'s 1 s default. openclaw#155910 and openclaw#155888 already fixed individual fixtures by capturing deliveries; this widens the shared fence so the remaining callers (persistence, timing, resume, task-replacement, chat.abort-*) stop racing it. Test contract change only; no product change. The related `build-artifacts` failure (`sqlite-sessions-transcripts-flip-proof` rejecting the delete-drain `stopReason`) was fixed on main in parallel by `9b877337ffb`; this branch merged that and carries no change of its own for it. ## Change - `src/agents/subagents/registry/subagent-registry.persistence.test-support.ts`: `vi.waitFor(..., { timeout: 10_000 })` in `settleSubagentRegistryPersistenceWork`. ## Proof - The four affected files green in one local vitest run with the change (`Tests 26 passed`, `Tests 36 passed`). - `oxfmt --check` / `oxlint` clean on the changed file; exact-head hosted gates via `scripts/pr`.
Summary
Full Release Validation 35775979903 (CI child 35776854264, candidate
release/2026.9.6= main814a7e752afc+ locale refresh + #155892) failedsubagent-registry.persistence.test.ts,subagent-spawn.authority.test.ts,chat.abort-errors.test.tsandchat.abort-incarnation.test.tsinsettleSubagentRegistryPersistenceWorkwithresidual registry roots: tasks:delivery (2|4|6): expected N to be +0. All were green in the two previous validation runs.Bisected to #151917 (
68b724b355e, move terminal notification writes off the Gateway thread):subagent-registry.persistence.test.tspasses 30/30 at68b724b355e^and fails at68b724b355ewith the exact CI signature; on current main it fails 5/5 locally. Thetasks:deliveryroots are not leaked: with a 20 s fence the same test passes (3.3 s), i.e. uncaptured deliveries settle 1–2 s after the test body, while the shared helper usedvi.waitFor's 1 s default. #155910 and #155888 already fixed individual fixtures by capturing deliveries; this widens the shared fence so the remaining callers (persistence, timing, resume, task-replacement, chat.abort-*) stop racing it. Test contract change only; no product change.The related
build-artifactsfailure (sqlite-sessions-transcripts-flip-proofrejecting the delete-drainstopReason) was fixed on main in parallel by8ba18cf19ad; this branch merged that and carries no change of its own for it.Change
src/agents/subagents/registry/subagent-registry.persistence.test-support.ts:vi.waitFor(..., { timeout: 10_000 })insettleSubagentRegistryPersistenceWork.Proof
Tests 26 passed,Tests 36 passed).oxfmt --check/oxlintclean on the changed file; exact-head hosted gates viascripts/pr.