Skip to content

fix(test): avoid coauthor cleanup failures in fast CI workers - #158102

Closed
roboclaw-bot wants to merge 1 commit into
mainfrom
fix/test-coauthor-broker-routing-20260925
Closed

roboclaw-bot wants to merge 1 commit into
mainfrom
fix/test-coauthor-broker-routing-20260925

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Collaborator

Related: canonical CI failure

What Problem This Solves

Fixes co-author fixture cleanup failing in thread-based CI and leaving its state-directory selector active for later tests.

User Impact

Internal test routing only; production attribution, workspace resolution and database behavior are unchanged. The fixture now runs with the host-owned database broker required by its cleanup fallback. Existing cleanup custody and all assertions remain intact.

Why This Change Was Made

All nine attribution assertions passed in the failed run, but cleanup of an exited native worker reached a host-only broker path from a reused Vitest thread. The rejected cleanup left the fixture environment selected; a later workspace-default test then observed that same fixture root.

Register this stateful consumer with the existing parallel infra fork owner and preserve its former unit-fast watch admission. Extend existing registry, explicit/watch routing and compact-planner checks so the file has exactly one appropriate owner. No new worker configuration, serial pin, retry, timeout, cleanup suppression or environment-reset shortcut.

The initiating reason native cleanup became unsettled is still unknown. This repairs the demonstrated host-capability mismatch, not every possible native cleanup failure.

Contributor credit: requested by and co-authored with @vincentkoc.

Work sessions

Evidence

  • Controlled termination of the real native reclamation worker after test work reproduced the actual fallback: all nine attribution assertions pass, thread-based cleanup refuses host-broker admission, and the following workspace assertion observes the retained selector. The identical controlled boundary in a reused fork completes fallback cleanup, restores the environment, and passes all 11 assertions. This is fault-injection proof of the cleanup boundary, not a claimed reproduction of its original initiating cause.
  • Seven routing assertions fail without registration. With the repair, 738 selected registry/planner checks passed in 37.41 s wrapper wall; 1,155 unrelated cases were filtered, not counted as passes.
  • Uninstrumented registered-owner proof passed 21 cases: coauthor 9, workspace 2, prompt sibling 10. Combined wrapper wall 36.11 s including 17.77 s worker preparation; coauthor test-body time approximately 1.7 s. All production and fixture/test assertion source is unchanged.
  • Full changed-file gates passed in 173.12 s, including root-test typechecking, formatting/lint, dead-export scans and selected guards. Fresh independent review through P2 found no actionable findings (13.51 s). Hosted fixture job passed all nine coauthor cases in the intended infra fork config. Its owning group passed 634 tests with 10 skips; the fixture appears in exactly one decoded group and is excluded from all three unit-fast groups.
  • Current merge blocker: ready CI 36132619608 failed model-list inventory assertions and then cancelled remaining jobs. The discovery-lifecycle case returned no learned rows, and three freshness variants lost expected published rows. Source analysis identified the missing legacy-success discovery facts addressed by the existing #158113. That owning repair still needs its own CI/review corrections and landing; no duplicate patch is being added here. Independent base-versus-PR execution attribution remains unproven, and passing fixture qualification is not a green CI claim. Completed exact-head ClawSweeper review found no code/security findings.
  • The affected routing/test owners are unchanged on inspected main d43208fc; adjacent native-cleanup PRs do not supply this host routing change. No full-main recovery claim.

View the OpenClaw team session

Route the stateful coauthor fixture through the existing parallel infra fork owner so retired native-worker cleanup can use its required host broker. Preserve former unit-fast watch admission and all fixture assertions and custody rules; cover registry, explicit/watch routing and compact planning.

Co-authored-by: vincentkoc <[email protected]>
@clawsweeper

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

@roboclaw-bot
roboclaw-bot marked this pull request as ready for review September 25, 2026 12:01
@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 25, 2026
@clawsweeper

clawsweeper Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 25, 2026, 9:45 AM ET / 13:45 UTC (Revision 3).

ClawSweeper review

What this changes

Routes the Git co-author attribution test through the forked infrastructure test pool and adds checks for direct, watch, registry, and compact CI selection.

Merge readiness

✅ Ready for maintainer review

Current main still lacks the routing needed for this fixture’s cleanup fallback. The branch provides a distinct, source-supported repair with positive fixture evidence; the linked model-inventory failure does not supersede it.

Priority: P2
Reviewed head: 32e7f0cebb5168a254df11910f9deb03f1811101

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The narrow owner change is supported by direct fault-injection observations and a successful hosted fixture shard; the separate failed CI gate still governs merge.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (linked_artifact): The changed test-routing owner assigns the co-author fixture to the existing forked infrastructure project. The PR records a real native-worker fault injection that failed cleanup in a reused thread and completed cleanup with a clean following workspace assertion in a fork; exact-head hosted shard metadata also confirms success. The reviewer could not open the hosted logs through the proxy. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (linked_artifact): The changed test-routing owner assigns the co-author fixture to the existing forked infrastructure project. The PR records a real native-worker fault injection that failed cleanup in a reused thread and completed cleanup with a clean following workspace assertion in a fork; exact-head hosted shard metadata also confirms success. The reviewer could not open the hosted logs through the proxy. No stored-data contract changes.
Evidence reviewed 9 items Introduced change: The pinned merge-base-to-head diff adds the co-author fixture to the database-worker registry and former-fast watch map, with routing assertions; it changes no production or fixture assertion source.
Still needed on main: The fetched main registry and former-fast map do not contain the co-author fixture; the four-file comparison shows the routing change remains unique to this branch.
Existing fork owner: The infrastructure config admits registered database-worker tests into an isolated fork pool.
Findings None None.
Security None None.

How this fits together

OpenClaw’s test planner assigns test files to Vitest worker pools. The co-author fixture uses shared database state, so its cleanup may need the host database broker before a later test can use a clean environment.

flowchart LR
A[Co-author test] --> B[Test routing registry]
B --> C{Selected project}
C --> D[Infrastructure fork]
D --> E[Host database broker]
E --> F[Fixture cleanup]
F --> G[Clean next test]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +15. Total +15 across 4 files.

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

Review metrics

None.

Technical review

Best possible solution:

Keep this fixture with its single forked infrastructure owner and existing cleanup contract, then let the normal merge gate validate the combined tree after the separate model-inventory repair.

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

Yes for the cleanup fallback: the fixture, thread-only host-broker rejection, and forked owner give a concrete fault-injection path, with before-and-after observations recorded in the PR. The spontaneous worker exit that first exposed it has not been explained.

Is this the best way to solve the issue?

Yes. Reusing the existing forked infrastructure owner supplies the required host broker while preserving the fixture’s cleanup and attribution assertions.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P2: The repair addresses a bounded CI fixture cleanup failure without changing production behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (linked_artifact): The changed test-routing owner assigns the co-author fixture to the existing forked infrastructure project. The PR records a real native-worker fault injection that failed cleanup in a reused thread and completed cleanup with a clean following workspace assertion in a fork; exact-head hosted shard metadata also confirms success. The reviewer could not open the hosted logs through the proxy. No stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. The changed test-routing owner assigns the co-author fixture to the existing forked infrastructure project. The PR records a real native-worker fault injection that failed cleanup in a reused thread and completed cleanup with a clean following workspace assertion in a fork; exact-head hosted shard metadata also confirms success. The reviewer could not open the hosted logs through the proxy. No stored-data contract changes.

Evidence

What I checked:

  • Introduced change: The pinned merge-base-to-head diff adds the co-author fixture to the database-worker registry and former-fast watch map, with routing assertions; it changes no production or fixture assertion source. (test/vitest/vitest.database-worker-core-paths.mjs:58, 32e7f0cebb51)
  • Still needed on main: The fetched main registry and former-fast map do not contain the co-author fixture; the four-file comparison shows the routing change remains unique to this branch. (test/vitest/vitest.database-worker-core-paths.mjs:725, af32e81d1441)
  • Existing fork owner: The infrastructure config admits registered database-worker tests into an isolated fork pool. (test/vitest/vitest.infra.config.ts:8, 32e7f0cebb51)
  • Cleanup boundary: The attribution suite cleans its shared state after all cases; fixture cleanup waits for session-state cleanup before restoring environment selectors, while shared-state admission rejects a non-host thread. (src/agents/git-coauthor-attribution.test.ts:38, 32e7f0cebb51)
  • Host-only admission: The existing shared-state store rejects admission outside the process main thread with a host-broker error, supporting the reported thread-versus-fork mechanism. (src/infra/sqlite-worker-store.ts:219, 32e7f0cebb51)
  • Behavior proof: The captured PR body reports controlled termination of the real native worker: cleanup failed in the reused thread and retained the selector before the change, while the fork completed fallback cleanup and the following workspace assertion passed. The original spontaneous reason for worker exit remains unknown. (32e7f0cebb51)

Likely related people:

  • vincentkoc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Dallin Romney: 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 (2 earlier review cycles)
  • reviewed 2026-09-25T12:14:43.813Z sha 32e7f0c :: needs maintainer review before merge. :: none
  • reviewed 2026-09-25T12:51:50.531Z sha 32e7f0c :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Sep 25, 2026
@steipete

Copy link
Copy Markdown
Contributor

Closing as superseded by 6d32778 (test(agents): await fixture-owned attribution cleanup), which is on main. It fixes the same co-author teardown failure at its owner: git-coauthor-attribution.test.ts now delegates teardown to the awaited fixture cleanup (including custom-store databases), so shared state no longer closes while agent resources are still retiring. It was proven with 20 standalone runs and three original-selector replays.

With the owner fixed, rerouting this test onto the host-broker infra config isn't needed. The branch's two red shards were unrelated models-list freshness assertions.

@steipete steipete closed this Sep 27, 2026
@RomneyDa
RomneyDa deleted the fix/test-coauthor-broker-routing-20260925 branch October 22, 2026 03:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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.

2 participants