Repository navigation
fix(doctor): defer update session-entry inspection when snapshot space runs out - #196370
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: blocked before merge. What this changesThis PR defers session-entry inspection during updates when disposable SQLite snapshot storage is exhausted. Example: Agent main needs a 21 GiB inspection snapshot, but temporary storage is full.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 2 items remain Keep open: this maintainer-authored PR addresses a current update failure, but its new tests exceed the repository’s test-line budget. Priority: P1 Before merge
Findings
Tests
Agent review detailsHow this fits togetherUpdate activation invokes Doctor’s config preflight and ordered migration steps; session-entry repair inspects agent databases and returns changes, warnings, and receipts to the updater. flowchart TD
A[Update activation] --> B[Doctor config preflight]
B --> C[Session entry repair]
C --> D[SQLite snapshot staging]
D --> E[Capacity warning]
E --> F[Deferred migration receipt]
F --> G[Later activation steps]
Technical reviewBest possible solution: Retain the focused deferral in the existing repair owner and add the justified test-budget allocation. Do we have a high-confidence way to reproduce the issue? Current source shows snapshot-capacity errors becoming a required-step refusal, and the PR supplies a matching injected-failure regression; no product execution was performed during this read-only review. Is this the best way to solve the issue? The smallest fix belongs in the existing raw repair owner: classify disposable capacity failure, preserve the source and genuine refusals, and propagate a recoverable receipt through its callers. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 5df392447e95. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceAcceptance criteria:
What I checked:
PR surfaceSource +26, Tests +187, Docs +7. Total +220 across 5 files. Added test files: 1. 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:
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 Reviewed November 9, 2026, 8:29 PM ET / November 10, 2026, 01:29 UTC. |
d080ebf to
6dd06f6
Compare
…e runs out During an update, a SqliteSnapshotCapacityError while staging the read-only session-entry snapshot refused the required session-entry-state step and stopped activation, even though nothing had been read or changed. Skip that target with a recoverable deferred warning instead, and let doctor --fix finish it after the update. Other failures, and runs outside an update, still refuse.
A drained, custodied family is now read in place, so the capacity deferral applies to families that still hold WAL frames.
6dd06f6 to
c8a297e
Compare
|
Merged via squash auto-merge.
|
…e runs out (openclaw#196370) * fix(doctor): defer update session-entry inspection when snapshot space runs out During an update, a SqliteSnapshotCapacityError while staging the read-only session-entry snapshot refused the required session-entry-state step and stopped activation, even though nothing had been read or changed. Skip that target with a recoverable deferred warning instead, and let doctor --fix finish it after the update. Other failures, and runs outside an update, still refuse. * test: allocate update session-entry capacity regression lines * test(doctor): keep update capacity fixtures on the private-snapshot path A drained, custodied family is now read in place, so the capacity deferral applies to families that still hold WAL frames. * test: allocate drained capture test lines from openclaw#196346
Preserve the upstream test-growth policy and dynamic dependency roots: #196370 #197250 #197602 Remove only the superseded task-owned 128-line grant. Keep the original 157-line record, upstream Doctor allocation and retired scalar deletion. The staged checker against 0626eb5 passed: net +157, allowance 400, allocation credit 157. The measured workload remains frozen at 79f5aeb.
…e runs out (#196370) * fix(doctor): defer update session-entry inspection when snapshot space runs out During an update, a SqliteSnapshotCapacityError while staging the read-only session-entry snapshot refused the required session-entry-state step and stopped activation, even though nothing had been read or changed. Skip that target with a recoverable deferred warning instead, and let doctor --fix finish it after the update. Other failures, and runs outside an update, still refuse. * test: allocate update session-entry capacity regression lines * test(doctor): keep update capacity fixtures on the private-snapshot path A drained, custodied family is now read in place, so the capacity deferral applies to families that still hold WAL frames. * test: allocate drained capture test lines from #196346 (cherry picked from commit ef47e2e) Co-authored-by: RomneyDa <[email protected]>
…law#194599) An agent database on an older schema is now reported as a required state migration, so the managed service is parked with the existing "run openclaw doctor --fix" guidance instead of restart-looping the Gateway. The session-SQLite import still defers such a target and processes the others (fixes openclaw#194580). Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: steipete <[email protected]> (cherry picked from commit 8bea0c1) Release adaptation: Classify only older canonical agent schemas as existing state-migrations maintenance; Doctor continues deferring matching targets. Keep newer schema refusal/media migration identity. No schema/version/data migration changes; retain focused Gateway parking, committed reader and Doctor regressions. Later cancellation-owner and unrelated Doctor repairs are not prerequisites. Follow-up dispositions: 410c0dd refactor(infra): read SQLite cancellation from its scope owner (openclaw#200179); 8cd7d87 chore(ci): drop retired test-lines allocation records (1/3) (openclaw#197655); 0e966cc fix: avoid agent database stalls after worker retirement (openclaw#194484); ef47e2e fix(doctor): defer update session-entry inspection when snapshot space runs out (openclaw#196370); 715c610 fix(doctor): repair retained ISO session end timestamps (openclaw#194685) Validation: Source baseline old-schema error was generic SqliteSchemaMismatchError and did not trigger service maintenance parking. Matching existing maintenance codec and Doctor catch reviewed; exact regression group queued. diff check passed. Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit f61a73edfda73dc6452f3e0e534cb9e891c05ae6) (cherry picked from commit 4e8445923f2522eb6b42ab705e15624a1a674a39)
Related: #196346, #192699
What Problem This Solves
Fixes: an update stops mid-activation and leaves the Gateway stopped when Doctor has no temporary space for the read-only snapshot it uses to inspect session entry state, even though it read and changed nothing.
User Impact
User impact: on a host short of temporary space, the update now finishes and reports a warning such as
Session entry state inspection deferred for agent main: … Free temporary snapshot space, then run openclaw doctor --fix after the update.Previouslysession-entry-staterefused (step-refused), which halted every later migration step and kept the Gateway stopped. On the affected Gateway the snapshot needed 21 GiB with the disk already full. No configuration or migration is needed.Why This Change Was Made
session-entry-stateis a required step. Its read-only scan stages a private snapshot of each agent database, and any scan error became a step refusal. ASqliteSnapshotCapacityErroronly means the disposable snapshot location ran out of space or quota: the scan never opened the source and wrote nothing. The memory-core Doctor check already treats this error class as a deferrable warning (#192699).prepareSessionEntryRepairsnow skips a target whose raw scan fails withSqliteSnapshotCapacityErrorwhile an update is in progress (OPENCLAW_UPDATE_IN_PROGRESS, which shipped updaters already set). It records a warning for that target, and the prelude reports the step asdeferredwith a recoverable disposition, so later steps continue. That target's media migration stays deferred too. Deferred receipts already flow into the update's post-install warnings. Config preflight forwards the same warning.Unchanged: any other scan error, any failure after the scan (backup, apply), and every run outside an update still refuse. A row the scan skipped stays in its legacy shape. Canonical readers keep refusing such rows with the existing migration-required error until
doctor --fixruns.This complements #196346, which removes the snapshot entirely for drained databases. This change covers databases that still have WAL frames, and any other snapshot shortfall.
Update behavior: the change lives in the candidate's Doctor and keys on a marker published updaters already set, so it applies to updates driven by existing updaters as soon as the candidate includes it.
Evidence
src/commands/doctor-session-entry-state.update-capacity.test.tsruns the repair inside the update's migration capture with a legacy row, as activation does. Snapshot staging is made to fail with a capacity error.Failing check session-entry-state (step-refused): SQLite read-only worker failed while creating its private snapshot, the production failure. Here the repair returns the deferral warning, the capture receipt reports the database unchanged, and the source bytes are identical.session-entry-state-preparation,media-persistence,session-entry-state,cold-navigation) recordsession-entry-stateasdeferredand runcold-navigationafterwards. On main the run throws.node scripts/check-changed.mjspasses typecheck, lint, format, docs and the ratchets, with the dead-export scan skipped because it already fails on main for untouched files. Autoreview (P0–P2) is scoped-clean.c8a297e5), and main still fails with the production error.196370-update-session-entry-capacity.txtallocates this PR's 203 lines. fix(doctor): updates fail on a full disk because Doctor copies a stopped database just to read it #196346 merged without an allocation after main had used its headroom, which left main 128 lines over the ceiling;196346-drained-capture-in-place.txtallocates exactly those 128 lines. The ratchet passes with slack 0.check-changedpasses onc8a297e5.OPENCLAW_PUBLISHED_DRIVER_LEGACY_SQLITE=1 bash scripts/e2e/published-driver-update-docker.shagainst6dd06f64:PASS published 2026.11.2 → candidate 2026.11.2 (6dd06f64…): finished, readyz=200, running version verified. The shippedlatestupdater drove the update (205 s) and the repeat maintenance run. Both agent databases (main,second) migrated from schema 27 to 41 with an unchanged logical SHA-256,integrity: ok, and no foreign-key failures. With normal disk space the session-entry inspection ran without deferring: the update output has noSession entry state inspection deferredwarning.