Skip to content

test(tasks): close sqlite borrowers before registry reload - #156131

Merged
RomneyDa merged 1 commit into
mainfrom
fix/scorecard-task-borrower-cleanup
Sep 23, 2026
Merged

RomneyDa merged 1 commit into
mainfrom
fix/scorecard-task-borrower-cleanup

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Sep 23, 2026 •

Copy link
Copy Markdown
Member

Summary

  • close the shared state database asynchronously before task-registry reload boundaries
  • keep the task operations product proof from leaving a worker borrower alive across resets

Validation

  • pnpm test src/tasks/task-operations.e2e.test.ts --maxWorkers=1
  • pnpm check:changed

Closes the task-operations borrower cleanup failure cluster from maturity scorecard run 35794246666.

Test cost

  • Focused proof body: 2.416s; Vitest duration: 13.36s.
  • Focused-command wall: 25.52s.
  • Exact-head hosted CI: 16m22s (run 35813301453).

@clawsweeper

clawsweeper Bot commented Sep 23, 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 size: XS maintainer Maintainer-authored PR labels Sep 23, 2026
@clawsweeper

clawsweeper Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 22, 2026, 11:58 PM ET / September 23, 2026, 03:58 UTC (Revision 2).

ClawSweeper review

What this changes

The task operations test now waits for SQLite workers to close before resetting or reloading the task registry.

Merge readiness

✅ Ready for maintainer review

The focused cleanup remains useful on current main. The prior timing-evidence request is resolved, and this review found no blocking defects.

Priority: P3
Reviewed head: 06d28b7ffbf52819998d2af13336fcc8f7b5c9b5

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused lifecycle repair with preserved assertions, resolved timing feedback, and successful CI on the reviewed commit.
Proof confidence 🌊 off-meta tidepool Not applicable: This MEMBER-authored test-only PR is exempt from external-contributor runtime proof. The supplied focused-test timing and verified successful head CI support validation; no persisted-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: This MEMBER-authored test-only PR is exempt from external-contributor runtime proof. The supplied focused-test timing and verified successful head CI support validation; no persisted-data contract changes.
Evidence reviewed 6 items Introduced change: The pinned merge-base-to-head diff changes only the task operations test: it awaits the existing database lifecycle owner before cleanup and three registry reloads. Existing assertions remain intact.
Cleanup ordering matches the existing owner: The asynchronous close drains registered worker resources before retiring native database handles. Registry reset separately invokes the store's synchronous close, so awaiting drainage first addresses the active-borrower boundary without weakening the production invariant.
Registry reset closes its store: The reset clears process-local registry state and calls the current store's close operation; it does not itself await worker cleanup.
Findings None None.
Security None None.

How this fits together

OpenClaw's task registry stores background-task status in SQLite for CLI and chat operations. This integration test reloads persisted tasks and checks notifications, auditing, and maintenance.

flowchart TD
 A[Task operations test] --> B[CLI and chat operations]
 B --> C[Task registry and SQLite]
 C --> D[Await worker cleanup]
 D --> E[Reset registry memory]
 E --> F[Reload persisted tasks]
 F --> G[Check task behavior]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +6. Total +6 across 1 file.

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

Review metrics

Metric Value Why it matters
Focused test cost 2.416s test body; 25.52s command wall The supplied timing evidence resolves the previous review request and places test execution below the documented five-second target.

Technical review

Best possible solution:

Keep test reloads ordered through the existing asynchronous SQLite lifecycle owner while preserving the persisted-task assertions.

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

Yes, source identifies the fixture failure path: registry reset closes a store while worker borrowers can remain active. Tests were not executed during this read-only review.

Is this the best way to solve the issue?

Yes. Awaiting the existing database cleanup owner before reset is a narrow repair that preserves the integration test's behavior checks.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 85b8d7747892.

Labels

Label changes:

  • add P3: This is a bounded test-lifecycle repair with no production behavior 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: This MEMBER-authored test-only PR is exempt from external-contributor runtime proof. The supplied focused-test timing and verified successful head CI support validation; no persisted-data contract changes.

Label justifications:

  • P3: This is a bounded test-lifecycle repair with no production behavior 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: This MEMBER-authored test-only PR is exempt from external-contributor runtime proof. The supplied focused-test timing and verified successful head CI support validation; no persisted-data contract changes.

Evidence

What I checked:

  • Introduced change: The pinned merge-base-to-head diff changes only the task operations test: it awaits the existing database lifecycle owner before cleanup and three registry reloads. Existing assertions remain intact. (src/tasks/task-operations.e2e.test.ts:83, 06d28b7ffbf5)
  • Cleanup ordering matches the existing owner: The asynchronous close drains registered worker resources before retiring native database handles. Registry reset separately invokes the store's synchronous close, so awaiting drainage first addresses the active-borrower boundary without weakening the production invariant. (src/state/openclaw-state-db-cache.ts:562, 06d28b7ffbf5)
  • Registry reset closes its store: The reset clears process-local registry state and calls the current store's close operation; it does not itself await worker cleanup. (src/tasks/task-registry-query.ts:542, 06d28b7ffbf5)
  • Current-main necessity: The fetched main version still resets the registry directly at the three reload boundaries and lacks the new asynchronous cleanup. No implementation-on-main or shipped-fix conclusion is warranted. (src/tasks/task-operations.e2e.test.ts:78, 85b8d7747892)
  • Prior review request resolved: The captured PR body now reports a 2.416-second test body, 13.36-second Vitest duration, 25.52-second focused-command wall time, and 16m22s hosted CI duration. GitHub independently confirms that the linked run completed successfully on the reviewed head. This resolves the previous review's sole requested rank-up move. (06d28b7ffbf5)
  • Area-history routing: Available main history records recent task-test maintenance by Peter Steinberger; GitHub maps the cited commit's author to steipete. This supports routing, not an introduction or regression attribution. Older blob inspection was unavailable. (src/tasks/task-operations.e2e.test.ts, 19fae01395e5)

Likely related people:

  • 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-23T03:16:09.490Z sha 06d28b7 :: needs changes before merge. :: none

@RomneyDa

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@clawsweeper

clawsweeper Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@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 23, 2026
@RomneyDa
RomneyDa enabled auto-merge (squash) September 23, 2026 06:52
@RomneyDa
RomneyDa merged commit bb7c06f into main Sep 23, 2026
165 checks passed
@RomneyDa
RomneyDa deleted the fix/scorecard-task-borrower-cleanup branch September 23, 2026 06:53
vincentkoc added a commit to ycmjbot-bot/openclaw that referenced this pull request Sep 23, 2026
* commit '3ab93b4ea59804b34d02a696382db16dc95189bb': (80 commits)
  fix(gateway): keep session refreshes moving during unrelated writes (openclaw#156286)
  chore(deps): update fs-safe to 0.18.2 (openclaw#156262)
  refactor(plugins): extract ClawHub plugin archives once (openclaw#156246)
  improve(llm-core): avoid unnecessary tool validation sets (openclaw#152066)
  fix(backup): verification accepts archives missing captured databases (openclaw#156211)
  fix: cancel Guest work when its original access is revoked (openclaw#156106)
  fix(test): classify drained legacy migration refusals
  fix(anthropic): finish Opus 5.5 defaults and thinking display (openclaw#156093)
  refactor(agents): share native harness tool execution (openclaw#154217)
  fix(ui): carry typed ownership through short-route resolution
  test(worktrees): accept additive gc result fields (openclaw#156127)
  test(tasks): close sqlite borrowers before registry reload (openclaw#156131)
  chore(autoreview): sync Astra high defaults (openclaw#156175)
  refactor(node-host): await prepared workspace storage (openclaw#149519)
  improve: speed up cold Node test planning (openclaw#156234)
  fix(doctor): avoid slow legacy ownership repair in source checkouts (openclaw#156238)
  improve: speed up native build artifact validation (openclaw#156219)
  fix(ui): preserve short-route resolution ownership
  fix(doctor): name retained session metadata conflicts (openclaw#156162)
  perf(tasks): bound creation selection to matching runs (openclaw#156183)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 24, 2026
@roboclaw-bot roboclaw-bot mentioned this pull request Sep 24, 2026
2 of 8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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