Skip to content

fix(test): prevent late announcements from contaminating registry tests - #157681

Merged
steipete merged 2 commits into
mainfrom
codex/deflake-registry-settlement
Sep 25, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/deflake-registry-settlement

Conversation

@steipete

@steipete steipete commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an intermittent subagent registry test failure when announcement cleanup from an earlier case reaches a later case's shared mock.

User Impact

No user-visible behavior changes. This is a test fixture repair that keeps asynchronous cleanup within the case that started it.

Why This Change Was Made

The persisted-completion case waits for the registry outcome but can finish before its eligible announcement cleanup settles. Join that work through the existing observeRootWork owner in finally, after the original outcome and archive assertions. Move the same case into the existing task-settlement helper to respect the main fixture's line budget, preserving its registration position, setup, and assertions. The later case's announcement count and 20-second fake-time advance remain unchanged.

Evidence

A controlled delay at the real announcement-module loader reproduced the original count failure: 185 cases passed and the later case saw two calls instead of one. The extra call carried the earlier producer's run ID. With the fixture join, the same held loader kept settlement pending until release, cleanup completed in its originating case, and all 186 cases passed. No announcement was fabricated or filtered.

The final two-file candidate passed 20 full-file runs (3,720 cases; median 26.965 seconds, range 23.64–35.81), three original 88-file cohorts (1,478 passes and 14 existing skips each; 96.29, 92.61, and 96.56 seconds), and three additional lifecycle/cleanup/recovery shards. Selected formatting, size/assertion, graph, type, and lint checks passed, and independent review found no actionable issue.

Those stress results bind to the original failing CI merge b6f43e66c1f6c2bfd76a38be542349adedee525d with candidate tree 9964f3ae878e4d216f27ee5542382e7c41067c25. The patch is integrated onto main 0484d7a3ecf52589b0d3d98741e58e5f6b5bf661, preserving its newer registration awaits and shared scope observer. On published head e4dc6855acc59eff578c8fd684575a9840a08caa, the pristine whole file passed all 186 cases in 33.93 seconds. A narrowly scoped real-loader hold also passed all 186 in 30.39 seconds: the actual current settler stayed pending until release, the producer announced before reset with zero remaining roots, and the later unchanged 20-second assertion saw only run-aborted-end. Exact-head CI 36073249467 completed successfully. Remote proof used Node 24.19.0, two workers, and the original 8 GiB V8 limit on a 16 GB host, versus roughly 32 GB available in the original CI runner. The controller retained all repetition summaries and successful gate results; raw per-run logs became unavailable after the proof lease completed.

The historical CI log did not record the second caller's arguments. This proves a controlled cross-fixture mock leak, not the exact historical caller or duplicate production transport delivery. No new test cases, production changes, timeout increases, or retry-based fixes are introduced.

Initial integrated CI exposed a pre-existing UpdateStepResult type import error outside this patch. The branch incorporates the canonical fix from #157659 (b5cfc8dd9221e23c04f336555eb061a289ec5b4d); the net PR remains the same two fixture files.

An initial integration diagnostic passed the producer barrier but failed the later count assertion (185 passes, one failure). That probe wrapped every loader call in an additional async step; its second caller was not recorded. The corrected probe returns unselected loader promises unchanged, restores the loader spy immediately after the producer settles, and records target identities before the assertion. The earlier confounded result is retained without attributing its unobserved caller. Current raw logs were collected and hash-verified before the lease was closed.

@clawsweeper

clawsweeper Bot commented Sep 24, 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.

@steipete
steipete marked this pull request as ready for review September 24, 2026 23:19
@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: S labels Sep 24, 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 24, 2026
@clawsweeper

clawsweeper Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 24, 2026, 7:51 PM ET / 23:51 UTC.

ClawSweeper review

What this changes

The branch moves a subagent registry test into its existing settlement helper and waits for that case’s asynchronous announcement cleanup before it finishes.

Merge readiness

✅ Ready for maintainer review

Keep open. Current main still has the unjoined test case, while the proposed fixture repair addresses a credible cross-case announcement leak. No actionable patch defect emerged from source review.

Priority: P3
Reviewed head: e4dc6855acc59eff578c8fd684575a9840a08caa

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused fixture repair uses an existing cleanup observer and retains the original assertions, with credible reported validation.
Proof confidence 🌊 off-meta tidepool Not applicable: The changed owner is a registry test fixture, and Repository State identifies a MEMBER author, so the external-contributor proof gate does not apply. The PR reports a controlled delayed-loader before/after run on an earlier candidate; exact published-head barrier proof remains pending. 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 changed owner is a registry test fixture, and Repository State identifies a MEMBER author, so the external-contributor proof gate does not apply. The PR reports a controlled delayed-loader before/after run on an earlier candidate; exact published-head barrier proof remains pending. No stored-data contract changes.
Evidence reviewed 7 items Introduced fixture repair: The introduced delta preserves the existing test assertions and registration position while adding a finally block that joins observed cleanup work.
Current main still needs the fix: Current main retains the original case without a cleanup join; its two affected files also match the PR base.
Existing cleanup observer: The helper observes admitted root work and asynchronous scope runs, drains newly admitted work, and restores its spies when finished.
Findings None None.
Security None None.

How this fits together

The subagent registry reconciles child-run state with persisted session results and then performs completion cleanup, including announcements. Its test suite uses shared mocks to check those outcomes across successive cases.

flowchart LR
A[Persisted child result] --> B[Registry sweep]
B --> C[Completion reconciliation]
C --> D[Announcement cleanup]
D --> E[Test work observer]
E --> F[Next test case]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +26. Total +26 across 2 files.

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

Review metrics

None.

Technical review

Best possible solution:

Keep asynchronous announcement settlement within the test case that starts it, preserving the original reconciliation assertions and the later case’s announcement-count check.

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

Yes, for a controlled fixture race: hold the announcement-module loader and run the registry suite through the later count assertion. The PR reports that result, while this read-only review did not execute it on current main.

Is this the best way to solve the issue?

Yes. Joining work through the existing root-work observer addresses the originating fixture without weakening either case’s assertions or changing production delivery.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This is a bounded test-fixture reliability repair with no user-visible runtime change.
  • 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 changed owner is a registry test fixture, and Repository State identifies a MEMBER author, so the external-contributor proof gate does not apply. The PR reports a controlled delayed-loader before/after run on an earlier candidate; exact published-head barrier proof remains pending. No stored-data contract changes.

Label justifications:

  • P3: This is a bounded test-fixture reliability repair with no user-visible runtime change.
  • 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 changed owner is a registry test fixture, and Repository State identifies a MEMBER author, so the external-contributor proof gate does not apply. The PR reports a controlled delayed-loader before/after run on an earlier candidate; exact published-head barrier proof remains pending. 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)

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
steipete enabled auto-merge (squash) September 24, 2026 23:57
@steipete
steipete merged commit 2ef3b4a into main Sep 25, 2026
128 of 130 checks passed
@steipete
steipete deleted the codex/deflake-registry-settlement branch September 25, 2026 00:04
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash auto-merge.

vincentkoc added a commit that referenced this pull request Sep 25, 2026
* commit 'ef2dd3235123371860c9154da7b47b2c1e940788': (41 commits)
  fix(ci): prevent Security Review checkout retry collisions (#157652)
  fix(ci): recover interrupted Security Review response bodies (#157651)
  test(ui): capture live operator authority in guest question fixture
  refactor(agents): deslop runners, harness and recovery (#157294)
  fix(auth): preserve Copilot tenant credentials during Doctor repair (#139131)
  refactor(msteams): share stored service URL validation (#157706)
  fix(codex): honor configured tool PATH in native commands (#157290)
  refactor(msteams): share approval kind labels (#157705)
  fix(sessions): keep session results current during cold reads (#156121)
  fix(testing): capture bounded upgrade integrity diagnostics (#157535)
  refactor(i18n): reuse native branch candidate extraction (#157636)
  fix(update): preserve recovery files after ownership refusal (#148890)
  fix(test): prevent late announcements from contaminating registry tests (#157681)
  fix(e2e): scan full onboarding logs for prompts (#157624)
  refactor(session-tools): derive contracts from schemas (#156365)
  refactor(channels): derive config contracts from schemas (#156367)
  perf(test): reuse MCP archives and batch worker fixture copies (#157689)
  refactor: reuse prepared fixtures in slow core tests (#157685)
  refactor(codex): reuse marketplace reference selection (#157621)
  chore(ui): refresh control ui locales (#157710)
  ...
vincentkoc added a commit that referenced this pull request Sep 25, 2026
* commit '229ab8a1fe957d3d4822309a39ddf9c7ec616395': (25 commits)
  test(ui): capture live operator authority in guest question fixture
  refactor(agents): deslop runners, harness and recovery (#157294)
  fix(auth): preserve Copilot tenant credentials during Doctor repair (#139131)
  refactor(msteams): share stored service URL validation (#157706)
  fix(codex): honor configured tool PATH in native commands (#157290)
  refactor(msteams): share approval kind labels (#157705)
  fix(sessions): keep session results current during cold reads (#156121)
  fix(testing): capture bounded upgrade integrity diagnostics (#157535)
  refactor(i18n): reuse native branch candidate extraction (#157636)
  fix(update): preserve recovery files after ownership refusal (#148890)
  fix(test): prevent late announcements from contaminating registry tests (#157681)
  fix(e2e): scan full onboarding logs for prompts (#157624)
  refactor(session-tools): derive contracts from schemas (#156365)
  refactor(channels): derive config contracts from schemas (#156367)
  perf(test): reuse MCP archives and batch worker fixture copies (#157689)
  refactor: reuse prepared fixtures in slow core tests (#157685)
  refactor(codex): reuse marketplace reference selection (#157621)
  chore(ui): refresh control ui locales (#157710)
  docs(gateway): show how we build OpenClaw on Team (#157675)
  refactor: verify IRC surrogate chunking over loopback (#157580)
  ...
vincentkoc added a commit that referenced this pull request Sep 25, 2026
* fix(ui): keep Stop available while drafts cannot send

* chore: integrate main fixes for Stop UI validation

* commit 'ef2dd3235123371860c9154da7b47b2c1e940788': (41 commits)
  fix(ci): prevent Security Review checkout retry collisions (#157652)
  fix(ci): recover interrupted Security Review response bodies (#157651)
  test(ui): capture live operator authority in guest question fixture
  refactor(agents): deslop runners, harness and recovery (#157294)
  fix(auth): preserve Copilot tenant credentials during Doctor repair (#139131)
  refactor(msteams): share stored service URL validation (#157706)
  fix(codex): honor configured tool PATH in native commands (#157290)
  refactor(msteams): share approval kind labels (#157705)
  fix(sessions): keep session results current during cold reads (#156121)
  fix(testing): capture bounded upgrade integrity diagnostics (#157535)
  refactor(i18n): reuse native branch candidate extraction (#157636)
  fix(update): preserve recovery files after ownership refusal (#148890)
  fix(test): prevent late announcements from contaminating registry tests (#157681)
  fix(e2e): scan full onboarding logs for prompts (#157624)
  refactor(session-tools): derive contracts from schemas (#156365)
  refactor(channels): derive config contracts from schemas (#156367)
  perf(test): reuse MCP archives and batch worker fixture copies (#157689)
  refactor: reuse prepared fixtures in slow core tests (#157685)
  refactor(codex): reuse marketplace reference selection (#157621)
  chore(ui): refresh control ui locales (#157710)
  ...

Co-authored-by: Vincent Koc <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 25, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 25, 2026
* fix(ui): keep Stop available while drafts cannot send

* chore: integrate main fixes for Stop UI validation

* commit '5dae23c843013fce2e0bb80037d232bbabfc70e5': (41 commits)
  fix(ci): prevent Security Review checkout retry collisions (openclaw#157652)
  fix(ci): recover interrupted Security Review response bodies (openclaw#157651)
  test(ui): capture live operator authority in guest question fixture
  refactor(agents): deslop runners, harness and recovery (openclaw#157294)
  fix(auth): preserve Copilot tenant credentials during Doctor repair (openclaw#139131)
  refactor(msteams): share stored service URL validation (openclaw#157706)
  fix(codex): honor configured tool PATH in native commands (openclaw#157290)
  refactor(msteams): share approval kind labels (openclaw#157705)
  fix(sessions): keep session results current during cold reads (openclaw#156121)
  fix(testing): capture bounded upgrade integrity diagnostics (openclaw#157535)
  refactor(i18n): reuse native branch candidate extraction (openclaw#157636)
  fix(update): preserve recovery files after ownership refusal (openclaw#148890)
  fix(test): prevent late announcements from contaminating registry tests (openclaw#157681)
  fix(e2e): scan full onboarding logs for prompts (openclaw#157624)
  refactor(session-tools): derive contracts from schemas (openclaw#156365)
  refactor(channels): derive config contracts from schemas (openclaw#156367)
  perf(test): reuse MCP archives and batch worker fixture copies (openclaw#157689)
  refactor: reuse prepared fixtures in slow core tests (openclaw#157685)
  refactor(codex): reuse marketplace reference selection (openclaw#157621)
  chore(ui): refresh control ui locales (openclaw#157710)
  ...

Co-authored-by: Vincent Koc <[email protected]>
vincentkoc added a commit that referenced this pull request Sep 25, 2026
* refactor(ui): share slash-command failure results

* Merge main to incorporate the upstream update type fix

* commit '0484d7a3ecf52589b0d3d98741e58e5f6b5bf661': (68 commits)
  fix(subagents): stop completion transcript retry loops (#157571)
  perf(sessions): remove duplicate foreground history reference scans (#157572)
  improve(typesafe): defer startup work until the first decision (#157380)
  fix(update): restore npm-pack helper typechecking (#157659)
  fix(packaging): avoid heap exhaustion on large bundles (#157471)
  refactor(infra): share process error handler registries (#157632)
  chore(ui): refresh control ui locales (#157573)
  fix(gateway): release remote Skills subscriptions when shutdown drains (#157592)
  perf(plugins): reuse declared tool membership during resolution (#156205)
  fix(ui): pasted text previews fail before sending (#157390)
  fix(agents): wait for database resources during deletion (#157631)
  improve: move operator profile database reads off the Gateway thread (#155800)
  fix: explain rejected settings without losing edits (#157549)
  fix: keep Gateway responsive while recording trajectory events (#157598)
  fix(auth): show SIWC email and selected model account identity (#157629)
  docs: explain Codex app approval precedence (#155089)
  refactor(wizard): share select prompt requests (#157607)
  fix(ui): omit empty sections from conversation Markdown exports (#157590)
  fix(doctor): explain update lint supervisor refusals (#156547)
  fix(ui): GitHub folder links lose repository context (#157619)
  ...

* Merge frozen main to include the question fixture authority fix

* commit '229ab8a1fe957d3d4822309a39ddf9c7ec616395': (25 commits)
  test(ui): capture live operator authority in guest question fixture
  refactor(agents): deslop runners, harness and recovery (#157294)
  fix(auth): preserve Copilot tenant credentials during Doctor repair (#139131)
  refactor(msteams): share stored service URL validation (#157706)
  fix(codex): honor configured tool PATH in native commands (#157290)
  refactor(msteams): share approval kind labels (#157705)
  fix(sessions): keep session results current during cold reads (#156121)
  fix(testing): capture bounded upgrade integrity diagnostics (#157535)
  refactor(i18n): reuse native branch candidate extraction (#157636)
  fix(update): preserve recovery files after ownership refusal (#148890)
  fix(test): prevent late announcements from contaminating registry tests (#157681)
  fix(e2e): scan full onboarding logs for prompts (#157624)
  refactor(session-tools): derive contracts from schemas (#156365)
  refactor(channels): derive config contracts from schemas (#156367)
  perf(test): reuse MCP archives and batch worker fixture copies (#157689)
  refactor: reuse prepared fixtures in slow core tests (#157685)
  refactor(codex): reuse marketplace reference selection (#157621)
  chore(ui): refresh control ui locales (#157710)
  docs(gateway): show how we build OpenClaw on Team (#157675)
  refactor: verify IRC surrogate chunking over loopback (#157580)
  ...

* chore: merge frozen main prerequisite repairs

Co-authored-by: Vincent Koc <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 26, 2026
* refactor(ui): share slash-command failure results

* Merge main to incorporate the upstream update type fix

* commit 'dda1f68bfa102cb804392c0e7cc22c0566a0944a': (68 commits)
  fix(subagents): stop completion transcript retry loops (openclaw#157571)
  perf(sessions): remove duplicate foreground history reference scans (openclaw#157572)
  improve(typesafe): defer startup work until the first decision (openclaw#157380)
  fix(update): restore npm-pack helper typechecking (openclaw#157659)
  fix(packaging): avoid heap exhaustion on large bundles (openclaw#157471)
  refactor(infra): share process error handler registries (openclaw#157632)
  chore(ui): refresh control ui locales (openclaw#157573)
  fix(gateway): release remote Skills subscriptions when shutdown drains (openclaw#157592)
  perf(plugins): reuse declared tool membership during resolution (openclaw#156205)
  fix(ui): pasted text previews fail before sending (openclaw#157390)
  fix(agents): wait for database resources during deletion (openclaw#157631)
  improve: move operator profile database reads off the Gateway thread (openclaw#155800)
  fix: explain rejected settings without losing edits (openclaw#157549)
  fix: keep Gateway responsive while recording trajectory events (openclaw#157598)
  fix(auth): show SIWC email and selected model account identity (openclaw#157629)
  docs: explain Codex app approval precedence (openclaw#155089)
  refactor(wizard): share select prompt requests (openclaw#157607)
  fix(ui): omit empty sections from conversation Markdown exports (openclaw#157590)
  fix(doctor): explain update lint supervisor refusals (openclaw#156547)
  fix(ui): GitHub folder links lose repository context (openclaw#157619)
  ...

* Merge frozen main to include the question fixture authority fix

* commit 'dc64cc3a3a3cf38fff1e44c1d7af42a32929d7e4': (25 commits)
  test(ui): capture live operator authority in guest question fixture
  refactor(agents): deslop runners, harness and recovery (openclaw#157294)
  fix(auth): preserve Copilot tenant credentials during Doctor repair (openclaw#139131)
  refactor(msteams): share stored service URL validation (openclaw#157706)
  fix(codex): honor configured tool PATH in native commands (openclaw#157290)
  refactor(msteams): share approval kind labels (openclaw#157705)
  fix(sessions): keep session results current during cold reads (openclaw#156121)
  fix(testing): capture bounded upgrade integrity diagnostics (openclaw#157535)
  refactor(i18n): reuse native branch candidate extraction (openclaw#157636)
  fix(update): preserve recovery files after ownership refusal (openclaw#148890)
  fix(test): prevent late announcements from contaminating registry tests (openclaw#157681)
  fix(e2e): scan full onboarding logs for prompts (openclaw#157624)
  refactor(session-tools): derive contracts from schemas (openclaw#156365)
  refactor(channels): derive config contracts from schemas (openclaw#156367)
  perf(test): reuse MCP archives and batch worker fixture copies (openclaw#157689)
  refactor: reuse prepared fixtures in slow core tests (openclaw#157685)
  refactor(codex): reuse marketplace reference selection (openclaw#157621)
  chore(ui): refresh control ui locales (openclaw#157710)
  docs(gateway): show how we build OpenClaw on Team (openclaw#157675)
  refactor: verify IRC surrogate chunking over loopback (openclaw#157580)
  ...

* chore: merge frozen main prerequisite repairs

Co-authored-by: Vincent Koc <[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: S 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