Repository navigation
fix(sqlite): preserve worker error identity for each caller - #146741
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs real behavior proof before merge. Reviewed September 13, 2026, 12:45 AM ET / 04:45 UTC. ClawSweeper reviewWhat this changesPreserves SQLite worker error types for callers that reload modules, while retaining shared causes, cycles, and unknown-write-outcome markers. Warning SQLite table change This PR modifies persisted SQLite tables in Merge readiness⛔ Blocked before merge - 2 items remain Keep open: current main still has the caller-constructor mismatch, and this PR provides a focused repair. No blocking correctness or security findings were identified. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw runs shared-state SQLite operations through a process-wide worker broker. Worker failures pass back through caller-facing APIs so application code can recognize maintenance, schema, and ownership refusals. flowchart LR
A[Storage caller] --> B[Shared worker broker]
B --> C[SQLite worker]
C --> D[Error payload]
D --> E[Caller error reconstruction]
E --> F[Typed refusal or unknown outcome]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +206, Tests +238. Total +444 across 6 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Keep one shared broker and reconstruct transported failures at caller boundaries without changing cached errors, durable state, or outcome classification. Do we have a high-confidence way to reproduce the issue? Yes, from source: reuse the broker after reloading caller modules, then trigger a newer-schema refusal; the old decoder returns an instance of the broker's constructor. The added worker regressions cover this path, but were not run here. Is this the best way to solve the issue? Yes: caller-boundary reconstruction addresses constructor identity while preserving the existing broker, transport format, and immutable cached failures. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 2716950abf05. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
Related: #144592
What Problem This Solves
Shared SQLite worker failures could lose their typed identity when a caller loaded a fresh module graph while reusing the broker.
User Impact
Callers reliably recognize schema, maintenance, and ownership refusals. Error causes and unknown-write-outcome markers retain their existing meaning.
Why This Change Was Made
The broker retains the existing closed error payload, and the current caller hydrates it using its own constructors. This covers shared opens, operations, and cleanup while preserving actor coalescing, cached rejection objects, and aliases and cycles in error graphs. Ordinary errors remain unchanged; no schema or wire format changes are needed.
Evidence
All 32 focused codec and real shared-worker cases pass, including reloaded caller open/execute failures and concurrent lower-level open refusals. Both unchanged-main controls fail at the intended constructor-identity assertion. Fresh P2 review, the full canonical changed gate (including core and core-test types), and the normal build pass.
The actual compiled shared worker preserves typed open and execute refusals on Node 24.21.0 and Bun 1.4.2, with matching recorded artifact hashes. Distinct reloaded module graphs are covered by the source regressions. Proof is pinned to commit 085e561 on base 5606d86. Two initial gate findings were corrected: the synthetic coordinator fixture now supplies its required directory, and retained execute/close methods bind explicitly to their original caller store.