Skip to content

fix(ci): run agents-support cleanup on the host thread - #155304

Merged
fuller-stack-dev merged 2 commits into
mainfrom
fix/agents-support-host-broker
Sep 22, 2026
Merged

fuller-stack-dev merged 2 commits into
mainfrom
fix/agents-support-host-broker

Conversation

@fuller-stack-dev

@fuller-stack-dev fuller-stack-dev commented Sep 22, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes agents-support CI cleanup failing when a retired agent lease needs the shared-state host broker.

Related: #147714

User Impact

No user-visible runtime change. This removes a test-runner mismatch blocking required CI for update recovery work; production broker and lease-safety checks stay unchanged.

Why This Change Was Made

The agents-support lane currently inherits worker threads on Linux/macOS. Retired-lease cleanup can reopen a SQLite worker through the main-thread host broker, which correctly refuses that operation from a worker thread. Run this lane in forked processes so its real cleanup executes on each process’s main thread. Other test lanes keep their existing pool selection. The existing pool-contract test explicitly requires forks for agents-support and keeps every sibling assertion unchanged.

Evidence

  • A task-private real SQLite lease reproduction fails during canonical drainage with threads and passes with forks, asserting that the claimed lease row is released. The fork control passes 52 cases.
  • The original 84-file failing selector on the candidate passed 1,725 cases, with one local profile-environment failure and one skip. The unchanged 23-case browser suite passes with the inherited profile unset. This is macOS evidence, not a claim that the original Linux ordering or whole CI is green.
  • The affected 43 mount-plan and 8 subagent refresh cases pass under the fork candidate.
  • The runner change passed changed checks and independent review. Its original failing hosted shard (checks-node-compact-small-5, job 106571747338) passed on the first PR head.
  • Hosted tooling CI exposed the stale pool-default assertion. After correcting that single assertion, the focused pool-contract case, root-test types, lint, formatting, and fresh independent review pass. The focused invocation intentionally selected 1 of 357 cases; it is not a whole-file pass claim.
  • Required CI on the updated head remains a landing gate.

Independent main failure: https://github.com/openclaw/openclaw/actions/runs/35659760018/job/106534471129

Downstream failure: https://github.com/openclaw/openclaw/actions/runs/35668781862/job/106560682106

The separate failed-exit repair in #154720 is not included. No production guard, timeout, retry, or assertion is weakened.

@openclaw-barnacle openclaw-barnacle Bot added size: XS maintainer Maintainer-authored PR labels Sep 22, 2026
@fuller-stack-dev
fuller-stack-dev marked this pull request as ready for review September 22, 2026 00:32
@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 22, 2026
@clawsweeper

clawsweeper Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 21, 2026, 8:59 PM ET / September 22, 2026, 00:59 UTC.

ClawSweeper review

What this changes

Runs the agents-support test lane in forked processes so SQLite cleanup executes on a process’s main thread, and updates the existing pool-contract assertion.

Merge readiness

✅ Ready for maintainer review

This remains a useful, narrowly scoped CI repair absent from the inspected main revision. No introduced correctness or security defect was found; maintainer-authored work is also protected from automatic closure.

Priority: P2
Reviewed head: 89731fcac4d14b3acd0202660d634a162aac72f7

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair using an established configuration path, with relevant reported validation and no actionable defect found.
Proof confidence 🌊 off-meta tidepool Not applicable: The external-contributor proof gate does not apply to this MEMBER-authored CI repair. The body reports real SQLite cleanup under forks, and GitHub confirms the cited candidate shard passed; underlying archived logs were unavailable for independent inspection.
Patch quality 🐚 platinum hermit (4/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 CI repair. The body reports real SQLite cleanup under forks, and GitHub confirms the cited candidate shard passed; underlying archived logs were unavailable for independent inspection.
Evidence reviewed 8 items Pinned introduced change: The merge-base-to-head patch adds the existing scoped pool override and changes one existing assertion. It introduces no production, dependency, workflow-permission, or storage changes.
Cleanup reaches a main-thread-only broker: Retired-lease cleanup waits for native retirement, revalidates ownership and database identity, then opens a cleanup store. That store reaches openSharedStateSqliteWorkerStore, which rejects callers when isMainThread is false. The patch preserves these checks.
Existing runner and configuration ownership: The non-isolated runner closes agent database resources before draining global singletons. createScopedVitestConfig already supports a pool override while retaining setup, test selection, parallelism, and worker limits; commands already uses forks through this same owner.
Findings None None.
Security None None.

How this fits together

The agents-support test lane exercises agent helpers and drains their database resources between files. Cleanup can reopen shared SQLite state through a broker that requires a main-thread caller.

flowchart TD
  A[Agent support tests] --> B[Forked test process]
  B --> C[Resource cleanup]
  C --> D[Shared state broker]
  D --> E{Main thread caller?}
  E -->|Yes| F[Release retired lease]
  E -->|No| G[Reject admission]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +2. Total +2 across 2 files.

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

Review metrics

None.

Technical review

Best possible solution:

Use the existing fork-pool override for this lane while retaining canonical cleanup, lease checks, and sibling scheduling behavior.

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

Yes, source establishes the failure path: threaded tests can drain a retired lease into a broker that rejects non-main-thread admission. This review did not execute that path.

Is this the best way to solve the issue?

Yes. The existing per-lane pool override addresses the execution-context mismatch without weakening production guards or adding a competing cleanup path.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 864e516174c2.

Labels

Label changes:

  • add P2: This repairs a bounded test-runner cleanup mismatch without changing user-facing runtime behavior.
  • 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 external-contributor proof gate does not apply to this MEMBER-authored CI repair. The body reports real SQLite cleanup under forks, and GitHub confirms the cited candidate shard passed; underlying archived logs were unavailable for independent inspection.

Label justifications:

  • P2: This repairs a bounded test-runner cleanup mismatch without changing user-facing runtime behavior.
  • 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 external-contributor proof gate does not apply to this MEMBER-authored CI repair. The body reports real SQLite cleanup under forks, and GitHub confirms the cited candidate shard passed; underlying archived logs were unavailable for independent inspection.

Evidence

What I checked:

  • Pinned introduced change: The merge-base-to-head patch adds the existing scoped pool override and changes one existing assertion. It introduces no production, dependency, workflow-permission, or storage changes. (test/vitest/vitest.agents-support.config.ts:13, 89731fcac4d1)
  • Cleanup reaches a main-thread-only broker: Retired-lease cleanup waits for native retirement, revalidates ownership and database identity, then opens a cleanup store. That store reaches openSharedStateSqliteWorkerStore, which rejects callers when isMainThread is false. The patch preserves these checks. (src/infra/sqlite-worker-store.ts:219, 89731fcac4d1)
  • Existing runner and configuration ownership: The non-isolated runner closes agent database resources before draining global singletons. createScopedVitestConfig already supports a pool override while retaining setup, test selection, parallelism, and worker limits; commands already uses forks through this same owner. (test/non-isolated-runner.ts:507, 89731fcac4d1)
  • Still absent from inspected main and release: Both fetched main and the supplied latest release retain the agents-support configuration without the fork override. The related open work does not establish a merged replacement. (test/vitest/vitest.agents-support.config.ts:7, 864e516174c2)
  • Release comparison: The configuration in v2026.9.5 also inherits its pool; this comparison does not claim that the newer cleanup failure existed in that release. (test/vitest/vitest.agents-support.config.ts:7, ec9c1a13db89)
  • Hosted candidate validation: GitHub confirms checks-node-compact-small-5 succeeded on the first PR head, which contains the unchanged pool override. The captured body additionally reports real SQLite lease release under forks and clearly limits its macOS and focused-test claims. This is not a claim that all checks passed on the updated head. (bd4abed367c7)

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.

@fuller-stack-dev
fuller-stack-dev enabled auto-merge (squash) September 22, 2026 01:05
@fuller-stack-dev
fuller-stack-dev merged commit e32fe54 into main Sep 22, 2026
134 checks passed
@fuller-stack-dev
fuller-stack-dev deleted the fix/agents-support-host-broker branch September 22, 2026 01:14
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Merged via squash auto-merge.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 22, 2026
* fix(ci): run agents-support cleanup on the host thread

* test(ci): require forked agents-support workers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR 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