Skip to content

fix: stop rejecting updates with enough snapshot space - #173284

Merged
fuller-stack-dev merged 7 commits into
openclaw:mainfrom
fuller-stack-dev:fix/update-snapshot-space-20261015
Oct 17, 2026
Merged

fuller-stack-dev merged 7 commits into
openclaw:mainfrom
fuller-stack-dev:fix/update-snapshot-space-20261015

Conversation

@fuller-stack-dev

@fuller-stack-dev fuller-stack-dev commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Update snapshot checks still reserve database copies removed by the single-image changes, so updates can fail even when enough space is available.

User Impact

Current SQLite candidates can proceed with space for one complete snapshot plus the largest database's temporary work, plugin files and the existing 64 MiB allowance. Older candidates and PostgreSQL exports keep the conservative requirement. An installed older updater keeps its early check until it is updated.

Why This Change Was Made

Budget current SQLite snapshots as S + L + plugins + 64 MiB, where S is all SQLite database sizes and L is the largest database. The candidate inventory capability selects this estimate; omission retains 2*S + 3*L + plugins + 64 MiB.

PostgreSQL portable exports remain beside their snapshots, so global PostgreSQL and any effective PostgreSQL family keep the larger allowance. External stores still follow the global setting when built-in families override it. The capability uses the canonical family selector and preserves the global guard. Copy, recovery and genuine-shortage refusal remain intact.

Related: #141773, #162403, #162429.

Evidence

Final head: d07252409d2213dbfbf9e78e3c0d1fe005b6e03d. It includes canonical main 4cb8e645 without rewriting published ancestry.

  • Two real 8 MiB SQLite fixtures with 100 MiB reported free: base refused at 120 MiB; the fix required 88.05 MiB and copied both payloads. Source hashes were unchanged and scratch was removed.
  • The mixed-workboard regression reproduced before correction: it incorrectly accepted the smaller allowance. It now keeps the conservative requirement, as do global PostgreSQL and global PostgreSQL with SQLite built-in overrides.
  • 24 focused capacity, inventory, plugin-inspection and rehearsal cases passed on the final head. The entire 205-line capacity test was audited for assertions, private fixtures, handles, worker settlement and cleanup. No distinct coverage was removed. Scoped lint and formatting passed; independent API review through P2 was clean on the staged correction.
  • All 42 exact-head CI jobs passed, including PostgreSQL conformance and core test types.
  • The full published-driver upgrade passed on the final head in one 608-second attempt. Published 2026.10.4 upgraded to candidate 2026.10.4@d0725240; the update command took 507.54 seconds. The recorded run finished, readiness returned HTTP 200, the running version matched, durable session content survived, incognito content did not persist, and service shutdown exited zero. The artifact binds the exact source and records joined cleanup with no lane failures.

Vincent Koc's packaging prerequisite #174463 is included. It fixed the missing Windows helper that had blocked both main and the earlier upgrade attempt. The final package build and integrity checks passed, and installation succeeded. The separate release-entry budget still fails at 47,823 entries against 47,500, so the overall Package Acceptance workflow is red. Canonical main already failed the same check at 47,789 entries. The package manifest, lockfile, checker and workflow are unchanged from that baseline through this PR's canonical base. Both counts remain below the shipped updater's 50,000-entry cap. No threshold or assertion was changed; this inherited release-readiness failure is not recorded as a passing check.

The recordings below exercise the isolated preflight/snapshot boundary with controlled free-space readings and real SQLite copies. This is a snapshot-creation budget, not a bound on arbitrary migration growth.

Base 9bf8143d508ee323b84e813a4b6699efa9a20d89:

https://91b59577e757131d68d55a471fe32aca.r2.cloudflarestorage.com/openclaw-crabbox-artifacts/crabbox-artifacts/v2/org/b3BlbmNsYXc/owner/Z2l0aHViOjI2MzA2MDIwMg/publish/public/20261015-163549-624850000/base.mp4?X-Amz-Expires=604800&X-Amz-Date=20261015T163550Z&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=a677a1e59413a4e54bcc2da5fec6164a%2F20261015%2Fauto%2Fs3%2Faws4_request&X-Amz-SignedHeaders=host&X-Amz-Signature=0ee938be69ad613da18712bec80e033dceef2370766201a4a88a8090521e1c56

Head 8f2388c860a5d682fc38b03002354738815f67fe:

https://91b59577e757131d68d55a471fe32aca.r2.cloudflarestorage.com/openclaw-crabbox-artifacts/crabbox-artifacts/v2/org/b3BlbmNsYXc/owner/Z2l0aHViOjI2MzA2MDIwMg/publish/public/20261015-163549-624850000/head.mp4?X-Amz-Expires=604800&X-Amz-Date=20261015T163550Z&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=a677a1e59413a4e54bcc2da5fec6164a%2F20261015%2Fauto%2Fs3%2Faws4_request&X-Amz-SignedHeaders=host&X-Amz-Signature=173516cf67830e4fd44d4ea971bd5aa5eaecc6dcbf855905bccc81366caac4dd

Reproduction contract · Evidence and exact test revisions · Artifact manifest

@clawsweeper

clawsweeper Bot commented Oct 15, 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.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 15, 2026
@clawsweeper

clawsweeper Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR reduces SQLite snapshot reservations when the candidate worker supports single-generation copying.

Example: Two SQLite databases with 8 MiB payloads and 100 MiB reported free space.

  • Before: The approximately 120 MiB reservation rejects snapshot preparation.
  • After: The 88.05 MiB reservation admits preparation and both database payloads are copied.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A focused, compatible bug fix with real-copy evidence, published-driver upgrade coverage, and no actionable finding; inherited package-budget failures remain recorded.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (linked_artifact): Supplied evidence covers the real preflight/snapshot boundary with controlled free-space readings and actual SQLite copies, plus an exact-head published-2026.10.4 CLI upgrade preserving durable state and returning readiness; GitHub confirms the successful lane and source-bound artifact, although this review host could not replay the media or retrieve redirected logs.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Updates refuse to proceed even when the destination has enough space for the snapshots the current worker actually creates.
Reason: The maintainer-authored direction restores useful update behavior with a narrow estimate change and preserves older-candidate and PostgreSQL safeguards.

Merge readiness

✅ Ready for maintainer review

This PR fixes a current snapshot-capacity overestimate and preserves conservative handling for older candidates and PostgreSQL; no actionable correctness or security finding remains.

Priority: P2
Reviewed head: d07252409d2213dbfbf9e78e3c0d1fe005b6e03d

Before merge

None.

Findings

None.

Agent review details

How this fits together

The updater inventories source databases and plugin files, checks destination capacity, and asks the staged candidate worker to create disposable rehearsal state before activation.

flowchart TD
A[Update CLI] --> B[Initial capacity check]
B --> C[Candidate inventory worker]
C --> D[Engine and copy capability]
D --> E[Capacity admission]
E --> F[Private database and plugin copies]
F --> G[Candidate rehearsal]
Loading

Technical review

Best possible solution:

Use the candidate's copy capability to size SQLite rehearsal snapshots while retaining conservative admission for older workers and PostgreSQL exports.

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

Current main's arithmetic deterministically rejects the supplied two-database, 100 MiB-free scenario; the maintainer reports matching before-and-after boundary results, and no target code was run during this review.

Is this the best way to solve the issue?

The change fixes the admission estimate at its existing owner, uses the canonical engine selector, and preserves older-worker behavior without adding configuration or changing source data.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Snapshot capacity reservation changes intended behavior with a stated reason (3acd5c9: Reserve completed generations, Doctor backups, and raw, compacting, and publication copies to avoid exhaustion; 4e39969 subsequently included measured plugin payloads and destination selection.)
  • Candidate-worker inventory compatibility keeps the original intent (4e39969: Inventory and copying share a measured file plan; the optional capability preserves omission behavior for released older workers and leaves existing inventory outputs intact.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 8a2935f adds src/infra/update-candidate-state.ts:17 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 8a2935fbfe45; files: src/infra/update-candidate-state.ts)
  • Jason (Json): Raw commit c77a055 adds src/infra/update-candidate-state.ts:677 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: c77a055f0864; files: src/infra/update-candidate-state.ts)

PR surface

Source +24, Tests +205. Total +229 across 4 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 3 35 11 +24
Tests 1 205 0 +205
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 240 11 +229

Review metrics

Metric Value Why it matters
Production versus test changes Production +35/-11 lines; tests +205/-0 lines The production growth adds backward-compatible capability selection and mixed-engine handling; tests cover admission, actual copies, preservation, and cleanup.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: False capacity refusals affect updates on constrained filesystems, with a focused repair and conservative fallback.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (4 earlier review cycles)
  • reviewed 2026-10-15T16:51:33.918Z sha 8f2388c :: needs maintainer review before merge. :: none
  • reviewed 2026-10-16T18:26:50.715Z sha f2174e4 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-16T18:39:25.499Z sha 1b9a4a3 :: blocked before merge. :: none
  • reviewed 2026-10-17T00:20:58.459Z sha 8acc129 :: needs maintainer review before merge. :: none

Reviewed October 16, 2026, 9:07 PM ET / October 17, 2026, 01:07 UTC (Revision 5).

@fuller-stack-dev
fuller-stack-dev marked this pull request as ready for review October 16, 2026 18:21
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 16, 2026
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@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. and removed status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. 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 16, 2026
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Please review exact head 8acc1292e6720815fc5109a61dd5a3e7a003f3c4. The previous missing published-driver proof is now complete. The upgrade cell passed in one 606-second attempt: published 2026.10.4 updated to this candidate, HTTP readiness was 200, running version matched, durable session content survived, incognito content did not persist, and stop-service exited zero. Exact-source artifact and joined cleanup. All 43 CI jobs passed; 22 focused cases and independent API P0–P2 review passed locally.

The prerequisite #174463 is merged and incorporated. Package build and integrity both passed. Overall Package Acceptance remains red only because its separate installed-tree release-budget check counts 47,797 entries against 47,500. Canonical main reproduces that failure at ancestor 1b03b6d496c45a69895527595019cf6f5810b1ef, with 47,789 entries. Package manifest, lockfile, checker and workflow are unchanged between that main and this PR base. Both are below the shipped 50,000-entry limit. This inherited release issue is documented, with no threshold or assertion weakened.

No runtime deployment or proof waiver is requested.

@clawsweeper

clawsweeper Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Oct 17, 2026
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Final head d07252409d2213dbfbf9e78e3c0d1fe005b6e03d fixes the mixed-engine drift found before landing. It uses the canonical family selector while retaining the global PostgreSQL guard for external stores. The full 205-line capacity test was audited; 24 focused tests and all 42 exact-head CI jobs pass. Independent API review through P2 is clean.

The required published-driver upgrade now passed on this exact head in one 608-second attempt: published 2026.10.4 to d072524, finished update ledger, HTTP 200, running-version match, durable/incognito state checks, and service shutdown all passed. The artifact records the exact SHA, no lane failures, and joined cleanup.

Package build, integrity and installation passed. Overall Package Acceptance remains red only for the inherited release-entry budget: 47,823 vs 47,500, below the shipped 50,000 cap. Main already fails at 47,789; manifest, lockfile, checker and workflow are unchanged through this PR base. No budget or assertion was weakened. The PR body now records final-head evidence and this separate failure.

@clawsweeper

clawsweeper Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@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. 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 17, 2026
@fuller-stack-dev
fuller-stack-dev merged commit 712db88 into openclaw:main Oct 17, 2026
180 of 182 checks passed
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Merged via squash.

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

Labels

P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: M 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