Skip to content

refactor(scripts): share SQLite reliability message waits - #146900

Merged
vincentkoc merged 3 commits into
mainfrom
refactor/sqlite-reliability-ipc-waiters-20260913
Sep 13, 2026
Merged

vincentkoc merged 3 commits into
mainfrom
refactor/sqlite-reliability-ipc-waiters-20260913

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Sep 13, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

When a SQLite reliability probe's start callback throws, its IPC wait rejects but leaves its listeners and timer active.

User Impact

Internal reliability tooling now releases those resources on callback failure. Worker predicates, timeout diagnostics, crash behavior, and database checks are preserved; no migration or operator action is required.

Why This Change Was Made

Six copied IPC waiters now share the existing process lifecycle owner. Each caller keeps its message filter, deadline, and lazy diagnostics; restore filesystem barriers stay with the restore proof. Production changes: −114 lines; tests: +143 lines.

Evidence

  • At exact head 4dd954670e8e8f7ecc12c9f89691ae610f709a48, CI attempt 1 passed, including all 9 lifecycle tests, all 7 existing benchmark tests, all 4 suppression-audit tests, lint and pinned formatting. The required aggregate gate passed.
  • The benchmark job executed actual worker crash/recovery and IPC disconnect. The suppression audit verified the exact file/rule/count allowlist, including the intentional original-rejection exception.
  • 62 before/after waiter scenarios produced identical results, deadlines, and diagnostics. Six synchronous-action cases reproduced the old listener/timer leak and verified cleanup after the change. These comparisons used actual waiter functions with isolated in-memory timers; they did not run SQLite or spawn workers.
  • Root, independent source review and fresh P2 autoreview are clean. The conflict refresh retains both upstream Bun workaround entries and the IPC exception; all seven other PR files stayed byte-identical to the reviewed implementation.

Data Compatibility

The named “Add data-model compatibility proof” request is addressed by unchanged-contract evidence: database operations, schemas, schema versions, transactions, worker-side repair logic, crash scheduling, physical restore barriers and report shapes are unchanged. The exact-current-head real crash/recovery suite passed as linked above. This change only centralizes IPC settlement and releases listeners/timers on synchronous callback failure, so there is no data migration to exercise.

The latest exact-head review, revision 5, explicitly confirms that the earlier migration request is inapplicable and that no migration or upgrade exercise is warranted. Its generated checklist repeats that request; the unchanged contracts and current-head execution above provide its concrete disposition. No remaining source finding or rank-up move was reported.

@vincentkoc vincentkoc self-assigned this Sep 13, 2026
@clawsweeper

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

@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 13, 2026
@clawsweeper

clawsweeper Bot commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 13, 2026, 1:43 PM ET / 17:43 UTC (Revision 6).

ClawSweeper review

What this changes

Shares SQLite reliability probes’ worker-message waits and releases listeners and timers when callbacks throw, with focused lifecycle regression coverage.

Merge readiness

⛔ Blocked before merge - 1 item remains

The PR remains useful and has no actionable correctness findings. Current main retains the callback-failure resource leak. The previous migration-proof blocker is inapplicable because no persistent-data contract changes.

Priority: P3
Reviewed head: 4dd954670e8e8f7ecc12c9f89691ae610f709a48

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with meaningful lifecycle coverage and verified successful CI metadata; no substantive blocker remains.
Proof confidence 🌊 off-meta tidepool Not applicable: The MEMBER-authored PR is exempt from the external-contributor proof gate and changes no authority boundary. Source coverage exercises the shared waiter and real benchmark workers; GitHub confirms the linked head-specific CI succeeded, while raw logs were inaccessible.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The MEMBER-authored PR is exempt from the external-contributor proof gate and changes no authority boundary. Source coverage exercises the shared waiter and real benchmark workers; GitHub confirms the linked head-specific CI succeeded, while raw logs were inaccessible.
Evidence reviewed 7 items Shared lifecycle owner: The shared waiter registers listeners before invoking the action, preserves original rejection values, and removes its own listeners and timer on matching messages, errors, exits, timeouts, and synchronous callback failures.
Current main still needs the repair: The current-main writer invokes action inside the Promise executor without routing synchronous exceptions through cleanup; the Promise rejects while its timer and listeners remain registered. Current main and v2026.9.4 lack the new shared message waiter.
Prior compatibility request resolved: The complete introduced diff changes IPC settlement and its tests, not schemas, SQL operations, persisted formats, worker crash scheduling, or restore publication barriers. The PR body explicitly disposes of the previous migration request, consistent with the inspected source; no migration exercise is warranted.
Findings None None.
Security None None.

How this fits together

OpenClaw’s SQLite reliability scripts coordinate child workers to exercise snapshot, restore, repair, and crash recovery. The shared waiter receives worker messages and failures, then releases its resources before returning results to the probes.

flowchart TD
  A[Reliability probe] --> B[Register worker wait]
  B --> C[Optional worker command]
  C --> D[Worker messages]
  D --> E{Expected message or failure}
  E -->|Unrelated message| D
  E -->|Match or failure| F[Remove listeners and timer]
  F --> G[Continue probe or report error]
Loading

Before merge

  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Tests +143, Other -114. Total +29 across 8 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 143 0 +143
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 6 121 235 -114
Total 8 264 235 +29

Review metrics

None.

Stored data model

Persistent data-model change detected: migration/backfill/repair: scripts/lib/sqlite-reliability-index-repair.ts, unknown-data-model-change: scripts/lib/sqlite-reliability-index-repair.ts. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Keep IPC settlement in the existing process lifecycle owner while preserving each probe’s predicates, deadlines, diagnostics, and recovery checks.

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

Yes, from source: a synchronous action exception rejects the current-main writer wait without clearing its timer or listeners. This review did not execute that scenario locally.

Is this the best way to solve the issue?

Yes. Extending the existing lifecycle owner removes duplicated settlement logic and fixes exception cleanup without changing persistent-data or recovery contracts.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 9542320aa5cd.

Labels

Label justifications:

  • P3: This is a bounded internal reliability-tooling repair with no changed user configuration or runtime data contract.
  • 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 MEMBER-authored PR is exempt from the external-contributor proof gate and changes no authority boundary. Source coverage exercises the shared waiter and real benchmark workers; GitHub confirms the linked head-specific CI succeeded, while raw logs were inaccessible.

Evidence

What I checked:

  • Shared lifecycle owner: The shared waiter registers listeners before invoking the action, preserves original rejection values, and removes its own listeners and timer on matching messages, errors, exits, timeouts, and synchronous callback failures. (scripts/lib/sqlite-reliability-process.ts:8, 4dd954670e8e)
  • Current main still needs the repair: The current-main writer invokes action inside the Promise executor without routing synchronous exceptions through cleanup; the Promise rejects while its timer and listeners remain registered. Current main and v2026.9.4 lack the new shared message waiter. (scripts/lib/sqlite-reliability-writer.ts:142, 9542320aa5cd)
  • Prior compatibility request resolved: The complete introduced diff changes IPC settlement and its tests, not schemas, SQL operations, persisted formats, worker crash scheduling, or restore publication barriers. The PR body explicitly disposes of the previous migration request, consistent with the inspected source; no migration exercise is warranted. (scripts/lib/sqlite-reliability-restore.ts:117, 4dd954670e8e)
  • Meaningful lifecycle coverage: Nine test cases cover listener preservation, registration before synchronous replies, rejection identity, final diagnostics, deadlines, callback exceptions, and writer payload handling. Existing benchmark coverage launches real workers and checks crash recovery and IPC disconnect. The new fake-timer tests route to the tooling project, which disables file parallelism. (test/scripts/sqlite-reliability-process.test.ts:99, 4dd954670e8e)
  • Pinned CI identity verified: GitHub confirms CI attempt 1 and the linked benchmark job succeeded at the reviewed head: https://github.com/openclaw/openclaw/actions/runs/34755140020/job/103718324665. The raw log redirect was blocked by the reviewer environment, so detailed execution output was not independently inspected. No target code or tests were executed locally. (4dd954670e8e)
  • Area history and routing: Current-main history identifies prior lifecycle consolidation and repeated reliability-probe work by Peter Steinberger and Vincent Koc. GitHub commit metadata confirms the handles steipete and vincentkoc. A full blame traversal encountered an unavailable historical object; routing relies on the available history and commit records. (scripts/lib/sqlite-reliability-writer.ts, 61f278bbded9)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • vincentkoc: 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 (5 earlier review cycles)
  • reviewed 2026-09-13T09:45:17.177Z sha 275034b :: blocked before merge. :: none
  • reviewed 2026-09-13T10:41:00.502Z sha 275034b :: blocked before merge. :: none
  • reviewed 2026-09-13T11:32:24.363Z sha 203f5c6edd9ec44fb235be3437e8e57b176fd618 :: blocked before merge. :: none
  • reviewed 2026-09-13T11:47:33.949Z sha 4dd9546 :: blocked before merge. :: none
  • reviewed 2026-09-13T13:27:29.302Z sha 4dd9546 :: blocked before merge. :: none

@vincentkoc
vincentkoc marked this pull request as ready for review September 13, 2026 10:36
@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Sep 13, 2026
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Please review current head 203f5c6edd9ec44fb235be3437e8e57b176fd618. The lint follow-up only preserves original rejection identity with a documented suppression and renames the outer writer result. The PR now records the successful prior-head lifecycle and real crash/recovery tests, the pending current-head CI, and concrete unchanged-data compatibility evidence.

@clawsweeper

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

Re-review progress:

@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Please review exact head 7341604b4542a75bbeeb85b9eb842ae2d0652369. This final test-only follow-up registers the already-reviewed original-rejection suppression as one exact file/rule/count entry with its reason. The collector, equality guard and production code are unchanged. Prior-head oxlint and formatting passed; current-head guard and lifecycle/benchmark CI are pending.

@clawsweeper

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

Re-review progress:

@vincentkoc
vincentkoc force-pushed the refactor/sqlite-reliability-ipc-waiters-20260913 branch from 7341604 to 4dd9546 Compare September 13, 2026 11:42
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Please review exact head 4dd954670e8e8f7ecc12c9f89691ae610f709a48. Resolved the allowlist insertion conflict with current main; all existing entries and original IPC rejection semantics are preserved.

@clawsweeper

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

@vincentkoc
vincentkoc merged commit ef2861d into main Sep 13, 2026
141 of 143 checks passed
@vincentkoc
vincentkoc deleted the refactor/sqlite-reliability-ipc-waiters-20260913 branch September 13, 2026 17:45
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 13, 2026
* commit '201f11afefdb19a9c75e9d3542bf7425c80df7a7': (141 commits)
  fix: keep catalog discovery scoped and execution lazy (#147159)
  fix: serialize reclamation worker shutdown with foreground writes (#147178)
  test(sessions): cover abrupt committed transcript recovery (#143984)
  fix: stop transcript storms during context overflow recovery (#147202)
  fix: reduce CPU overhead for small history and usage reads (#147205)
  fix: resume tasks after tools finish and the model times out (#147203)
  refactor(scripts): share SQLite reliability message waits (#146900)
  feat(exec): configure approval reviewer thinking and fastMode (#147192)
  test: remove redundant Bonjour module headers (#146981)
  refactor: share streaming media tail boundary update (#146989)
  refactor(tui): classify resume candidates once (#146983)
  improve: skip unused toast dismissal work (#147196)
  fix(linux): recover saved remote connections without replacing active sessions (#146047)
  fix: doctor stays silent when Windows state dir is under OneDrive (#123720)
  feat: announce successful Daybreak retries (#147146)
  feat(code-mode): reuse results across code cells (#147154)
  refactor(test): reuse CLI plugin fixture writer (#147186)
  test: skip unused compiler setup in routing fixtures (#147194)
  test: reuse LINE webhook runtime fixture (#146710)
  fix(code-mode): check automation and process result types (#147143)
  ...
vincentkoc added a commit that referenced this pull request Sep 13, 2026
* commit '2d87daf04b78992382299d552f15ac84a86a23ed': (1815 commits)
  fix(ui): distinguish tool activity with semantic icons (#147207)
  fix(linux): recover completed Quick Chat replies without resending (#146048)
  feat(desktop): unify Tauri title bar and window controls (#147097)
  refactor(test): share plugin fixture server shims (#147225)
  perf(gateway): defer worker workspace execution imports (#143496)
  fix(gateway): post-ack webhook work fails with "Async work scope is closed" (#144801)
  refactor(scripts): centralize upgrade survivor version floors (#146975)
  fix(ci): check publication registries before FRV fanout (#147184)
  fix(qa): align system-agent delegation with channel contracts (#145905)
  improve: reduce repeated chat message identity work (#147210)
  fix(channels): remove stale pre-tool previews from Slack and Telegram (#147106)
  fix: keep catalog discovery scoped and execution lazy (#147159)
  fix: serialize reclamation worker shutdown with foreground writes (#147178)
  test(sessions): cover abrupt committed transcript recovery (#143984)
  fix: stop transcript storms during context overflow recovery (#147202)
  fix: reduce CPU overhead for small history and usage reads (#147205)
  fix: resume tasks after tools finish and the model times out (#147203)
  refactor(scripts): share SQLite reliability message waits (#146900)
  feat(exec): configure approval reviewer thinking and fastMode (#147192)
  test: remove redundant Bonjour module headers (#146981)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 14, 2026
…46900)

* refactor(scripts): share SQLite reliability message waits

* fix(scripts): preserve IPC rejection values without lint errors

* test(scripts): register IPC rejection suppression
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: M 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