Repository navigation
fix(sqlite): TEMP views invalidate sibling readers and worker logs lack timestamps - #199842
roboclaw-bot wants to merge 4 commits into
Conversation
…ck timestamps Worked on by: - @Patrick-Erichsen - @etzelm Co-authored-by: Patrick-Erichsen <[email protected]> Co-authored-by: etzelm <[email protected]> OpenClaw-Publication: 49a64d40-b9f0-45a8-9416-0441162b9932
|
🦞👀 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 maintainer review before merge. What this changesPreserves sibling SQLite readers when creating TEMP views and adds worker emission timestamps and transaction hold-start times. Example: One connection runs CREATE TEMP VIEW local_observer AS SELECT id FROM original while another retains admitted MAIN-schema facts.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Partial Merge readiness✅ Ready for maintainer review This PR provides a focused repair still needed on current main; no actionable correctness or security findings remain. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherSQLite mutation classification controls shared reader admission, while worker logging and transaction diagnostics provide timing information to operators. flowchart TD
A[SQLite operation] --> B[Mutation classifier]
B --> C[Connection local facts]
B --> D[Shared MAIN admission]
A --> E[Transaction diagnostics]
E --> F[Timestamped worker stderr]
F --> G[Host log relay]
Technical reviewBest possible solution: Merge the focused classifier and diagnostic repair while retaining the existing MAIN-DDL invalidation and JSON-output contracts. Do we have a high-confidence way to reproduce the issue? Current-main source establishes the TEMP-view misclassification and missing diagnostic timing, corroborated by the supplied before/after runtime output; this review executed no target code. Is this the best way to solve the issue? The patch repairs the existing owners directly and preserves subsequent MAIN-DDL invalidation, stderr routing, and lightweight worker initialization. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against f85e5863887b. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +5, Tests +27, Other -1. Total +31 across 11 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReviewed November 23, 2026, 11:58 PM ET / November 24, 2026, 04:58 UTC (Revision 3). |
Co-authored-by: etzelm <[email protected]>
Co-authored-by: etzelm <[email protected]>
Worked on by: - @etzelm Co-authored-by: etzelm <[email protected]> OpenClaw-Publication: 0df6fe85-57a2-4880-bdf7-4b0df0406b9c
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Related: #188274
What Problem This Solves
Creating a connection-local TEMP VIEW unnecessarily invalidates other SQLite readers, while worker console lines lack the emit time needed to attribute stalls accurately.
User Impact
TEMP views preserve sibling MAIN-reader admission. Worker diagnostics carry emitter-side timestamps, and slow transaction-hold warnings include the hold start time. No migration or user action is required.
Why This Change Was Made
Extend the existing TEMP-object classifier to views without suppressing subsequent MAIN DDL. Enable the existing timestamp mechanism in the two worker logging entry points and expose the already-measured hold start.
The worker registration fixture now keeps the real console exports and stubs only the two process-wide setters. The mock-export checker removed one obsolete baseline entry. The branch also incorporates the tested
mainrevision and resolves the SQLite store worker conflict.This does not address the exec-retry, proof-publication, or invalidation-message concerns in issue items a–c.
Evidence
Running-Gateway comparison on the reviewed head
Two isolated Gateways took the same
projects.registerrequest. The probe held a real SQLite store-worker commit and stalled the Gateway main thread for 2.2 seconds without changing its clock, logger or response.0828443372bea0f86c30cf59Both registrations returned the expected JSON. On both builds eight readiness probes timed out during the stall, and
/readyzreturned 200 before and after. This shows when the worker emitted its warning, not that the fix prevents stalls. TEMP-view behavior has its own two-connection proof below. Running-Gateway proof session.Tests
src/state/openclaw-agent-execution.registration.test.tsfailed at import (sqlite-store.worker.ts:74, missingsetConsoleTimestampPrefixon the mock) with all 11 cases skipped. This is thechecks-node-changed-compact-large-27failure.a0f86c30cf59: 101 focused tests passed across nine files, including timestamped SQLite worker stderr and clean JSON stdout through the real broker, plus worker lifecycle and close coverage. The mock-export guard, targeted lint, formatting, focused typechecks andgit diff --checkpassed. Repair and verification session · exact-head CI.Earlier runtime evidence (built
dist/, base 7ecd67c vs the handoff branch)Both sides were built with
pnpm buildand exercised through the compiled output only, with an isolated state directory and HOME. This earlier capture was not repeated ona0f86c30cf59.TEMP view admission. Two connections to one SQLite file, opened and admitted through the compiled
openNodeSqliteDatabaseandadmitSqliteSchema. The writer runsCREATE TEMP VIEW, thenCREATE TABLE.Worker timestamps. The shipped SQLite store worker and the shipped worker task server, run through the compiled
openSqliteWorkerStoreandWorkerTaskPool:Stdout stays
{"value":"ready"}and parses as JSON on both sides. The stock CLI (openclaw sessions --json) emits no worker log line at any level, so the worker entry points are the closest shipped seam.Slow hold start time. The compiled
runSqliteImmediateTransactionSyncwithslowTransactionHoldMs: 20and a real 60 ms hold. The "slow SQLite transaction hold" warning has nostartedAton base and"startedAt": "2026-11-23T03:06:16.974Z"(elapsedMs: 60) on the branch.The earlier harness evidence is separate from the running-Gateway comparison above. Harness scripts and full redacted logs are in the attached evidence bundle.
Original patch by Mitchell Etzel.
Worked on by
Work sessions
Linked for team reference; these sessions aren’t public.