Skip to content

fix(update): stop status reads from creating SQLite sidecars - #138917

Merged
fuller-stack-dev merged 2 commits into
openclaw:mainfrom
fuller-stack-dev:codex/update-history-readonly-final
Sep 6, 2026
Merged

fuller-stack-dev merged 2 commits into
openclaw:mainfrom
fuller-stack-dev:codex/update-history-readonly-final

Conversation

@fuller-stack-dev

@fuller-stack-dev fuller-stack-dev commented Sep 5, 2026 •

Copy link
Copy Markdown
Member

Related: #124396

Additional instructions

MUST: Keep Allow edits from maintainers enabled for this PR so maintainers
can help update the branch when needed.

What Problem This Solves

Reading update status could create SQLite WAL/SHM files when the state database was cold. The command returned correct history but changed the inspected database family.

Why This Change Was Made

The history owner's get/list functions now use the existing artifact-preserving shared-state reader. Active-run discovery already delegates to list. This preserves committed-WAL visibility, cached-handle reuse and isolation from uncommitted writes without changing the schema, records, retention or recovery authority.

User Impact

CLI status and Gateway history queries preserve the inspected database family and parent metadata. Missing databases and optional history tables stay missing. Cold reads may use private temporary storage; this is not a promise of zero filesystem writes.

Evidence

  • Unmodified built CLI cf127a39cb97ff5c3c2dfe8d4b37bc9dee9470e8 reproduced cold WAL/SHM creation. No-action, rejected-input and absent-database controls stayed unchanged. Seven regression assertions failed before the fix, then all 21 owner/shared-reader tests passed.
  • Red and independent macOS evidence: seven cases passed on base 581c, authored tree 8a183753acb4a5c1f6ced799bbfcaf9878a67765. Six CLI children exited naturally. Protected state stayed unchanged; only declared empty owned 0700 scratch was allowed. The author's original scratch-classifier failure is retained separately.
  • Linux CLI evidence and admission qualifications: no-action, rejected-timeout and retained committed-WAL cases passed on base 69587bbb6bf8b115e77ceeaf63e6eaf69893b1fa, authored tree bbf78916457e3686df2df07e461d931509fd2604. The target-native build and CLI ran on Linux x64, Node 24.19.0. Status returned all 17 expected history fields; the main-only discriminator had no history. Protected state and schema stayed unchanged, and the exact lease was released.
  • The independent Linux reports retain their setup-admission limitations. The separate source-aware qualification covers recorded bootstrap/account/caller ordering without inventing missing standalone records or regrading the independent reports. Coordinator observations are sampled; release is not proof of remote erasure.
  • The two-file patch passed focused max-P2 Autoreview. Integration at base 80a898, tree 7bd, passed 29 History/shared-reader/cache tests. The historical structural failure remains recorded: services had 721 roots against the 720 limit, also reproduced on unmodified 8bb. All 14 remaining native stages passed there. Canonical 5b099 corrected the routing. On final public 5f79151e, the native graph guard, core types and both affected infra/services type graphs passed with unchanged source and dependencies.
  • Exact-head CI 34008375493 passed on attempt 2. Attempt 1's compact-large-7 job ended by SIGKILL during active test output, without a reported assertion or watchdog failure. One targeted unchanged-job retry used the existing GitHub-hosted fork-retry route and passed. The original kill cause remains unproved; no code, limits or assertions changed. The aggregate ci-gate and security checks are green.
  • Completed current-head review found no actionable source or security issue. Its raw-artifact access limitation is retained separately from the published HTTP/hash verification.

The history-preserving, GitHub-signed head is 5f79151e76617147abbd2636955d6a66cc459526, with parents 3253f18df01790c3b3461867d6929451890aef21 and 6b3d88538e8fec95efb24a27e0df262b0d9a235f. Complete tree a75365014981b46fe5ecb447bb28b6bd0712a608 matches canonical 6b3 plus exactly the reviewed two History blobs. Native preparation and merge remain required.

Evidence retains its original source/build identities. Relevant source-impact checks carry unchanged behavior proof forward; older binaries are not relabeled as the final head. Existing notice retention and step settlement from #138737 remain intact.

This PR does not claim live Gateway, Windows, power-loss, package activation, writer extinction or durable crash recovery.

@fuller-stack-dev fuller-stack-dev self-assigned this Sep 5, 2026
@clawsweeper

clawsweeper Bot commented Sep 5, 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: S maintainer Maintainer-authored PR labels Sep 5, 2026
@fuller-stack-dev
fuller-stack-dev marked this pull request as ready for review September 5, 2026 06:17
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Retained before/after evidence for public head 3253f18df01790c3b3461867d6929451890aef21:

The archive preserves the author's original completed-cold classifier exit1 and its separate scratch disposition. Shared coordinator-parent movement remains unattributed. It includes no databases, credentials or agent transcript. Archive SHA-256: 6d6876247c4572808454137a01af8a592585502c252a75157385f908e000b01a. Publication manifest SHA-256: f600117154eb9dc197bc687d4e61cddcf2e6515be39a2cb8a6c3e4156c797290.

The public two-file patch remains bb68cbeaf76c62f871db36524424b20c735c3e2bfb71cebd2dcda07dadb2349e. Prior focused tests, native changed-file stages, max-P2 review and seven-step private CLI build are recorded in the PR body. These artifacts are private-candidate proof, not an exact-public-head binary run.

Exact-head CI33949402780 completed successfully. The native review artifacts remain NEEDS WORK pending the bounded Linux CLI/WAL run and completed bot/native landing gates. No Windows, power-loss, writer-extinction, live Gateway, package activation or crash-recovery claim.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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 5, 2026
@clawsweeper

clawsweeper Bot commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 5, 2026, 11:20 PM ET / September 6, 2026, 03:20 UTC.

ClawSweeper review

What this changes

Update status and history queries use the existing SQLite reader that preserves inspected database files, with regression coverage for committed history and transaction isolation.

Merge readiness

✅ Ready for maintainer review

The fix remains necessary: current main and the latest release still use the ordinary SQLite reader. No introduced correctness defect was found, and the supplied Linux CLI evidence resolves the previous review’s specific proof follow-up.

Priority: P2
Reviewed head: 5f79151e76617147abbd2636955d6a66cc459526

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with useful regression coverage and sufficient retained runtime evidence; no actionable patch defect remains.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): Retained macOS CLI evidence and the supplied completed Linux CLI/WAL report exercise status through the changed history owner, preserving protected files while returning committed history. The previous Linux follow-up is addressed. Evidence retains its private-candidate source identities and setup qualifications; raw linked artifacts could not be independently reopened here.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): Retained macOS CLI evidence and the supplied completed Linux CLI/WAL report exercise status through the changed history owner, preserving protected files while returning committed history. The previous Linux follow-up is addressed. Evidence retains its private-candidate source identities and setup qualifications; raw linked artifacts could not be independently reopened here.
Evidence reviewed 9 items Verified introduced change: The pinned base-to-head diff changes only the reader import and its get/list call sites in production. Active-run discovery delegates to list; queries, record decoding, writes, and schema remain unchanged. The complete introduced test diff was also inspected.
Existing shared reader preserves lifecycle boundaries: The helper reuses idle cached handles, skips handles with active transactions, preserves missing databases, and prepares isolated snapshots when a writable handle exists. Fresh reads retain schema and quarantine checks, and snapshot cleanup runs in finally.
Meaningful owner-boundary regression coverage: Six cold-read cases cover get/list/active with and without retained WAL. Additional cases cover an absent history table, cached writer usability, and exclusion of uncommitted writes. Filesystem metadata and content hashes detect side effects; a main-only control distinguishes committed WAL history from stale main-file data. Tests were inspected, not executed.
Findings None None.
Security None None.

How this fits together

The update ledger stores durable update progress and results in OpenClaw’s shared SQLite database. CLI status and Gateway history requests read those records to report active and completed updates.

flowchart TD
 A[CLI status or Gateway history request] --> B[Update history reader]
 B --> C{Idle cached database available?}
 C -->|Yes| D[Reuse existing handle]
 C -->|No| E[Prepare private database snapshot]
 F[Shared database and committed WAL] --> E
 D --> G[Return update records]
 E --> G
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source 0, Tests +137. Total +137 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 3 3 0
Tests 1 138 1 +137
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 141 4 +137

Review metrics

None.

Technical review

Best possible solution:

Keep history reads on the existing artifact-preserving owner while retaining committed-WAL visibility, cached writer reuse, and unchanged durable records.

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

Yes: cold update-status reads reach the ordinary SQLite reader on current main, and the supplied unmodified-CLI evidence records WAL/SHM creation. This review inspected the path without executing it.

Is this the best way to solve the issue?

Yes: selecting the existing artifact-preserving reader at the history owner is a focused repair that avoids duplicating snapshot logic or changing storage contracts.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 6c33a2f3b9b2.

Labels

Label justifications:

  • P2: This is a bounded correctness repair for status reads that unexpectedly create SQLite coordination files.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): Retained macOS CLI evidence and the supplied completed Linux CLI/WAL report exercise status through the changed history owner, preserving protected files while returning committed history. The previous Linux follow-up is addressed. Evidence retains its private-candidate source identities and setup qualifications; raw linked artifacts could not be independently reopened here.
  • proof: sufficient: Contributor real behavior proof is sufficient. Retained macOS CLI evidence and the supplied completed Linux CLI/WAL report exercise status through the changed history owner, preserving protected files while returning committed history. The previous Linux follow-up is addressed. Evidence retains its private-candidate source identities and setup qualifications; raw linked artifacts could not be independently reopened here.

Evidence

What I checked:

  • Verified introduced change: The pinned base-to-head diff changes only the reader import and its get/list call sites in production. Active-run discovery delegates to list; queries, record decoding, writes, and schema remain unchanged. The complete introduced test diff was also inspected. (src/infra/update-run-ledger.ts:456, 5f79151e7661)
  • Existing shared reader preserves lifecycle boundaries: The helper reuses idle cached handles, skips handles with active transactions, preserves missing databases, and prepares isolated snapshots when a writable handle exists. Fresh reads retain schema and quarantine checks, and snapshot cleanup runs in finally. (src/state/openclaw-state-db-readonly.ts:133, 5f79151e7661)
  • Meaningful owner-boundary regression coverage: Six cold-read cases cover get/list/active with and without retained WAL. Additional cases cover an absent history table, cached writer usability, and exclusion of uncommitted writes. Filesystem metadata and content hashes detect side effects; a main-only control distinguishes committed WAL history from stale main-file data. Tests were inspected, not executed. (src/infra/update-run-ledger.test.ts:118, 5f79151e7661)
  • Current main still needs the repair: Inspection of fetched main shows getUpdateRun and listUpdateRuns still calling withExistingOpenClawStateDatabaseReadOnly. Neither supplied merged related PR establishes that this sidecar repair has landed. (src/infra/update-run-ledger.ts:456, 6c33a2f3b9b2)
  • Latest release retains the ordinary reader: The supplied latest release, v2026.9.2, also uses the ordinary reader for both history entry points. (src/infra/update-run-ledger.ts, 3928bad9badf)
  • Previous Linux proof follow-up addressed: The captured report at fix(update): stop status reads from creating SQLite sidecars #138917 (comment) records Linux x64, Node 24.19.0 CLI execution on base 69587bb with authored tree bbf78916457e3686df2df07e461d931509fd2604. Retained-WAL status returned all 17 expected history fields in 892 ms; the main-only control lacked history, and protected files and schema remained unchanged. No-action and rejected-timeout controls passed. These are private-candidate results, not an exact-public-head binary run; the report retains its independent setup-admission qualifications.

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-05T06:44:07.263Z sha 3253f18 :: blocked before merge. :: none

@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Linux CLI/WAL evidence

The declared Linux check has now run. Crabbox run run_751198025005 executed source base 69587bbb6bf8b115e77ceeaf63e6eaf69893b1fa with authored tree bbf78916457e3686df2df07e461d931509fd2604, on Linux x64, Node24.19.0 and SQLite3.53.3. This is qualified private-candidate proof, not hosted CI for the current public head.

The prewritten sequence passed:

  • No-action control started no CLI and preserved protected/scratch state.
  • Invalid timeout exited1 with the exact expected error and preserved state.
  • Retained committed WAL returned all17 expected lastRun fields in892ms. The main-only discriminator contained no history row. Protected files,382 schema entries and123 table records stayed unchanged; only the declared empty owned0700 scratch directory remained.

Manifest and checksums include raw retained-WAL output, the unchanged contract, independent behavior report, its admission supplement and the separately labeled source-aware qualification. All10 uploaded files and the manifest were downloaded and hash-verified from this maintainer session. Links expire September13; this does not claim the earlier reviewer DNS limitation was independently resolved in that reviewer environment.

The independent reader passed the behavior cases but retained missing standalone pre-setup records. Its original and additive reports remain unchanged. The source-aware qualification checks the executed trusted bootstrap/account/caller against captured records; it does not invent missing records or convert the independent overall status to green. Sampled coordinator leaves are not writer-extinction proof, and watcher events can coalesce. Exact native and lease cleanup completed.

Current-main integration preserves #138737 notice and terminal-step behavior. The same two-file repair is undergoing its affected current-cache/native checks before signed publication. Required CI and native preparation/merge must then pass on the actual new public head. The old 3253f18 CI is not being substituted for that work. No schema/store change or full-atomic-update claim is introduced.

@fuller-stack-dev

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Please review current head 5f79151e76617147abbd2636955d6a66cc459526. The Evidence section now links the completed Linux CLI cases, unchanged independent reports and separate admission qualification: #138917 (comment).

The signed integration preserves the prior head and current canonical source. It changes only the two reviewed History files relative to its canonical parent. The original failures and older proof identities remain disclosed. This requests review only, not autofix or automerge.

@clawsweeper

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

@fuller-stack-dev
fuller-stack-dev merged commit 4ff9035 into openclaw:main Sep 6, 2026
371 of 373 checks passed
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Merged via squash.

@fuller-stack-dev
fuller-stack-dev deleted the codex/update-history-readonly-final branch September 6, 2026 03:33
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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