Skip to content

fix(update): refuse Git updates early when database backup space is insufficient - #183133

Closed
chelsealong wants to merge 2 commits into
openclaw:mainfrom
chelsealong:fix/codex-openclaw-183091
Closed

chelsealong wants to merge 2 commits into
openclaw:mainfrom
chelsealong:fix/codex-openclaw-183091

Conversation

@chelsealong

@chelsealong chelsealong commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Closes #183091

What Problem This Solves

A Git update can pass the candidate snapshot space check, spend time validating, then fail because its durable SQLite backup needs more space.

User Impact

Updates with measurably insufficient backup space now refuse before staging and show the required and available space. Disk use can still change during validation.

Why This Change Was Made

Preflight and activation now share the backup sizing formula. Candidate snapshots retain their smaller, separate budget and destination selection.

Evidence

With 140 MiB available for candidate snapshots and 100 MiB at the backup destination, the new regression returned success on the base source (expected refusal). With the fix, it refuses; raising backup space to 140 MiB admits it. The isolated Git updater suite confirms refusal before staging. The full build, 27 resource tests, 5 Git updater tests, focused backup capacity test, targeted test typechecks, lint, format, Docs MDX, and git diff --check passed before the directory-order test correction.

PR CI shard checks-node-changed-compact-large-6 failed on the earlier head because the new test assumed a fixed fs.readdir order. The assertion now compares sorted entries. On head 41604171816c, the focused CLI updater suite passed all 5 tests locally, as did targeted typecheck, lint, format, and git diff --check; the previously failing exact-head CI shard has also passed. Three PostgreSQL conformance jobs were still in progress when last checked.

The broad core typecheck has an unchanged TS2739 error in session-catalog.test-helpers.ts. The full backup suite encounters the same staging-directory trust error at /home on both patched and base source in this runner. Shipped-CLI low-space refusal and admission, and a latest-stable upgrade preserving settings and database content, remain unverified.

AI disclosure: generated and automatically reviewed with Codex.

@clawsweeper

clawsweeper Bot commented Oct 25, 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 docs Improvements or additions to documentation cli CLI command changes size: S labels Oct 25, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 25, 2026
@clawsweeper

clawsweeper Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: stale review; fresh review needed.

Summary
The latest durable ClawSweeper review was for head 58d1029e78f80412acf8909e88f75433a2eb585b, but the PR head is now 41604171816c1217b9571805060c11cad84c2d2d. Its old verdict and PR readiness labels are no longer current.

Next step
Comment @clawsweeper re-review when the current head is ready; pushes after the first review are not reviewed automatically.

Review history (1 earlier review cycle)
  • reviewed 2026-10-25T02:18:09.785Z sha 58d1029 :: needs real behavior proof before merge. :: [P2] Compare directory contents without relying on enumeration order

@chelsealong

Copy link
Copy Markdown
Contributor Author

The failed CI shard returned the expected directory entries in a different order. I changed the test to compare sorted entries. All five focused tests pass locally, along with the targeted CLI updater typecheck, lint, format check, and git diff --check. CI has not run on this edit yet.

Commit: 4160417

@chelsealong

Copy link
Copy Markdown
Contributor Author

The directory-order assertion is fixed in head 41604171816c, and exact-head CI shard checks-node-changed-compact-large-6 passed. I cannot provide the requested shipped-CLI low-space or latest-stable upgrade transcript from this runner. The PR body should retain that evidence gap; a re-review request would be premature.

@clawsweeper clawsweeper Bot removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Oct 27, 2026
@roboclaw-bot

Copy link
Copy Markdown
Collaborator

Thanks @chelsealong for working on this and correcting the directory-order assertion. This is already covered on main by #183177, commit 8738c09: 8738c09.

I checked current main (050238fdbdb0). Git updates pass the durable backup destination into the initial capacity check before candidate staging and the service-stop/mutation callbacks. Both Git and package updates now use the same backup/rollback capacity helper as activation, including separate source volumes, and report required/free space with instructions to free space before retrying. Main also has regression coverage for a candidate copy fitting while the durable backup does not.

The later capture batching (#188919), bounded capture and service recovery (#189025), and unsealed capture cleanup (#189249) are also present; they handle separate recovery concerns and retain this early capacity guard. Closing as superseded by the merged fix. Thank you for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Update disk preflight passes with a 9.3 GiB estimate, then activation needs 22.7 GiB and fails after 15 minutes of validation

2 participants