Skip to content

fix: prevent Bun Doctor and updates from failing to clone database commands - #172175

Merged
steipete merged 1 commit into
mainfrom
codex/bun-doctor-transfer-ownership
Oct 14, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/bun-doctor-transfer-ownership

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes Doctor migrations and updates failing with The object can not be cloned. when their SQLite maintenance runs on Bun.

User Impact

Bun installations can complete native Doctor maintenance and transfer database commands normally. Existing migration, byte-limit, cancellation and cleanup rules remain unchanged; no configuration or schema change is required.

Why This Change Was Made

The request-transfer optimization in #171940 transferred serializer-owned buffers directly. Bun's node:v8.serialize can return shared backing storage, which is cloneable but cannot appear in a transfer list. The SQLite broker now uses the existing ownedWorkerBytes policy for open input, optional preparation, inline commands and continuation frames, matching the reply and Git-worker paths. Eligible exclusive buffers retain the zero-copy path; shared or pooled storage is copied before transfer.

Evidence

The new regression failed on the original owner with the actual Bun DataCloneError. With the repair, the signed Bun 1.4.3 runtime completed a real maintenance lease, prepared open, inline append and 36 MiB framed append/readback, with transferred buffers detached after dispatch. A full isolated doctor --fix --non-interactive run exited 0, preserved synthetic agent data byte-for-byte, passed both database integrity checks, and released every maintenance lease and child.

All 17 focused tests passed, including existing 72 MiB framing/reopen, cancellation, queue credit, failed staging, close drainage and unrelated-buffer ownership coverage. Core types, the owning state/logging test type graph, focused lint and formatting passed. Independent P2 review found no actionable findings. The broader local check was stopped through its owned driver after scoped proof completed; its remaining checks are inconclusive and exact-head PR CI provides broad validation.

The broader changed gate encountered an existing environment-count mismatch: both the unchanged candidate baseline and repaired tree contain 455 names against a budget of 454, with no names added or removed by this change. The budget is not raised here.

@clawsweeper

clawsweeper Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@steipete
steipete marked this pull request as ready for review October 14, 2026 13:48
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: S labels Oct 14, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-14T13:49:19.674816Z cf5aa0f Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@steipete
steipete merged commit c49a8c9 into main Oct 14, 2026
193 of 194 checks passed
@steipete
steipete deleted the codex/bun-doctor-transfer-ownership branch October 14, 2026 14:25
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete added a commit that referenced this pull request Oct 14, 2026
The regression added by c49a8c9 (#172175) captures Worker.postMessage and invokes it with call(this). Record its one justified suppression in the explicit inventory.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 15, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 15, 2026
The regression added by c962a89 (openclaw#172175) captures Worker.postMessage and invokes it with call(this). Record its one justified suppression in the explicit inventory.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant