Repository navigation
fix(update): keep SQLite contention frames in bounded failure reports - #200322
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
@clawsweeper review Local ClawSweeper was unavailable; local autoreview completed without actionable P0-P2 findings. Please review the diagnostic-only change at 7eceae3, especially redaction, excerpt bounds, and preservation across repeated sanitization. |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. What this changesPreserves a separately bounded, redacted SQLite contention stack excerpt in update-failure JSON and repair prompts. Example: An openclaw doctor failure contains Error: database is locked and DatabaseSync.exec (node:sqlite:367:10) midway through long stderr.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Partial Merge readiness✅ Ready for maintainer review This PR addresses a confirmed diagnostic-loss problem using the existing sanitizer; source review found no introduced correctness or security defect. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe triage sanitizer projects failed updater results into saved support artifacts and repair-agent context, applying shared redaction and whole-record byte limits. flowchart LR
A[Failed update stderr] --> B[Triage sanitizer]
B --> C[Shared support redaction]
C --> D[Bounded failure JSON]
D --> E[Artifact reader]
E --> F[Repair prompt]
Technical reviewBest possible solution: Keep the focused excerpt in the existing sanitizer while leaving the underlying contention and prolonged-update investigation with the linked issue. Do we have a high-confidence way to reproduce the issue? Source inspection establishes that a stack in the middle of long stderr is omitted by current main; the PR reports a failing base regression, but this review ran no target code. Is this the best way to solve the issue? The smallest complete fix is the proposed optional excerpt in the existing sanitizer, preserving ordinary stderr, shared redaction, and aggregate bounds without adding another diagnostic owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 5fccb144deec. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +12, Tests +85, Docs +2. Total +99 across 3 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. Review metrics
LabelsLabel changes: No label changes. Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
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 Reviewed November 16, 2026, 7:30 PM ET / November 17, 2026, 00:30 UTC. |
…openclaw#200322) Update failure JSON and repair prompts now also keep any "SQLite contention call site:" block from a failed step's stderr: the error line and its first 12 stack frames, redacted the same way as stderr and capped at 1 KiB. The 384-byte stderr excerpt can cut those frames, which is why the 2026.11.4 predecessor-stop receipt "database is locked" failure could not be traced to a specific SQLite operation. The existing stderr and overall record limits are unchanged. Related openclaw#200289 Reported-by: @pestelence2k Co-authored-by: steipete <[email protected]>
#198968) * fix(update): keep the failure that started recovery in failure reports After any update failure, the recovery steps that follow also fail (gateway migration recovery, package-backup-retention, gateway recovery verification). The failure-report sanitizer kept only the latest three failed steps and pruned oldest first, so the step that started recovery was always dropped, and users could not report what went wrong. Keep the first failed step alongside the latest two, and when the byte budget forces pruning, drop middle records before it. The latest failure still wins when only two remain. Refs #197083 * test(update): expect the triggering failure in recovery triage prompts The recovery triage prompt fixture has five failed steps. Failure reports now keep the first failed step with the latest two, so the oldest failure replaces the second-latest one in the expected prompt details. Refs #197083 * fix(update): protect the latest failure when pruning failure reports Pruning removed the second record when the trigger came first, so a retained lint inventory record after the latest failure made the latest failure the one dropped. Protect the trigger and the latest failure by identity, drop other records first, and drop the trigger before the latest failure. Refs #197083 (cherry picked from commit 5df28e7) Backport review: source applies unchanged. #200322 is orthogonal SQLite diagnostic enrichment; #200742 repairs a separate lease owner. Both are outside this report-retention fix. Co-authored-by: RomneyDa <[email protected]> Co-authored-by: vincentkoc <[email protected]>
…#200322) Update failure JSON and repair prompts now also keep any "SQLite contention call site:" block from a failed step's stderr: the error line and its first 12 stack frames, redacted the same way as stderr and capped at 1 KiB. The 384-byte stderr excerpt can cut those frames, which is why the 2026.11.4 predecessor-stop receipt "database is locked" failure could not be traced to a specific SQLite operation. The existing stderr and overall record limits are unchanged. Related #200289 Reported-by: @pestelence2k Co-authored-by: steipete <[email protected]> (cherry picked from commit 1139903) Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit 4f16b8ec15a4c57de6bd8bdf67f96b2bca8f191b)
Related #200289
What Problem This Solves
Failed-update diagnostics can discard the SQLite call site when a Doctor failure's stack appears in the middle of long stderr.
User Impact
Operators can inspect the contention error and up to 12 leading stack frames in the saved failure JSON linked from the update report and in repair prompts. This is a diagnostic improvement, not a root-cause fix for the SQLite lock or prolonged update reported in #200289.
Why This Change Was Made
The existing triage owner retains an optional
sqliteContentionCallSiteexcerpt with the same secret/path redaction and a separate 1 KiB JSON-encoded UTF-8 cap. It survives artifact writing, reading, and prompt sanitization. Ordinary stderr retains its 384-byte head/tail limit, and the 8 KiB artifact and 4 KiB prompt-record limits still apply. Existing whole-record pruning can still omit older failed steps, and the byte cap can shorten long stacks.The Markdown report already links this support JSON; its existing layout is unchanged. The failure-report documentation now describes the retained excerpt and bounds.
Evidence
src/infra/update-run-step.ts:105-110drops ordinary exit-1 Doctor stderr from the ledger projection;src/infra/update-run-report.ts:433-440bounds the summary to 300 characters and only emits stderr for signals or candidate snapshots.src/infra/update-failure-report-artifact.ts:33-35likewise restricts its stderr appendix to signal failures and links support JSON at line 246. That JSON loses the middle stack atsrc/commands/triage-update.ts:371-374(384-byte head/tail excerpt).d29fad4e3e687dedf683e38ec35b12cb85510637: the middle-block regression failed; 12 existing tests passed. Fixed: 33 passed across four named files, including realistic multi-KB stderr, first-frame retention, the 12-frame limit, oversized UTF-8/JSON-escaped frames, redaction, repeated sanitization, rollback readers, prompt composition, and artifact writing.OPENCLAW_VITEST_RUNTIME=node timeout 120s pnpm test src/commands/triage-update.test.ts src/commands/triage-update-rollback.test.ts src/commands/triage-prompt.test.ts src/infra/update-failure-report-artifact.test.ts --maxWorkers=1. Runner wall time: 6.66 seconds; the changed-file command shard took 1.19 seconds. CI seconds are not yet available.--type-checkpassed throughscripts/run-oxlint.mjs; formatting andgit diff --checkpassed. Broad validation is left to PR CI under the host's limits. The original production update incident was not reproduced.7eceae3b44f3461db4e241af0f2de58e070b49fa. Local ClawSweeper was unavailable; hosted review follows the repository fallback.Reported by @pestelence2k
Work sessions
Linked for team reference; these sessions aren’t public.