Repository navigation
fix(backup): keep a configured agent's Git backup scope when it cannot be copied - #149265
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. Reviewed September 15, 2026, 2:47 PM ET / 18:47 UTC (Revision 5). ClawSweeper reviewWhat this changesPreserve configured agents’ previous Git backup scopes when their databases cannot be copied, refresh healthy agents, and report degraded backups. Merge readiness⛔ Blocked before merge - 1 item remains Keep open: this fixes a remaining backup defect in current main and v2026.9.4. No new blocking finding was identified; the earlier diagnostic-budget concern has an explicit maintainer disposition accepting it as follow-up. Priority: P1 Review scores
Verification
How this fits togetherGit backups turn configured OpenClaw SQLite databases into versioned snapshots in an operator-owned repository. Both manual and scheduled backups use this path to refresh snapshots and remove retired agent scopes. flowchart TD
A[Manual or scheduled backup] --> B[Configured database roster]
B --> C[Validated SQLite snapshots]
C --> D{Agent copy succeeds?}
D -->|Yes| E[Refresh backup scope]
D -->|No| F[Retain prior scope and warn]
B --> G[Prune removed agents]
E --> H[Git commit and recorded outcome]
F --> H
G --> H
Before merge
Agent review detailsSecurityNone. PR surfaceSource +19, Tests +150, Docs +8, Other -1. Total +176 across 8 files. View PR surface stats
Review metricsNone. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the approved retention contract and canonical snapshot validation, with combined diagnostic budgeting handled at the producer in a follow-up. Do we have a high-confidence way to reproduce the issue? Yes: source establishes the missing-database prune and old-schema abort paths, and the PR supplies a failing-before/passing-after command-process regression; this review did not execute it. Is this the best way to solve the issue? Yes: retaining the configured roster through existing staging and pruning is a focused repair that avoids migrating live databases or weakening snapshot validation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against e7dde047904e. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
62ab114 to
6907889
Compare
Keep configured scopes during --all backups when an agent database is missing or fails snapshot validation. Record degraded agents while copying healthy scopes, and prune only removed agents. Explicit selections still fail loudly.
6907889 to
b94044f
Compare
|
Merged via squash.
|
…t be copied (openclaw#149265) Keep configured agents' previous Git backup scopes when their databases are missing or fail snapshot maintenance validation during an all-agent backup. Refresh healthy scopes, prune only removed agents, and report degradation through CLI/JSON warnings and the recorded backup outcome. Explicit agent selections and runs with no copyable databases still fail. Real command-process regressions cover missing and old-schema agents, retained Git trees, healthy refreshes, removed-agent pruning, and recorded outcomes. The landing rebase preserves the reviewed patch exactly. Fixes openclaw#128010 Reported by @yetval (openclaw#128010). ClawSweeper's P2 combined-warning truncation finding is deferred under the approved P1 landing scope; the pushFailed flag and CLI/JSON diagnostics remain available.
Fixes #128010
What Problem This Solves
openclaw backup git create --alldeletes a configured agent's previous backup when its database is missing, or aborts every agent's backup when one database fails snapshot maintenance validation after an upgrade.Reported by @yetval (#128010).
User Impact
With
--all, eligible agents are refreshed, unavailable configured agents retain their previous scope, and only agents removed from configuration are pruned. Degraded agents appear in CLI warnings, JSONwarnings, and the existing recorded backup outcome.Explicit
--agentselection still fails for an unavailable database. Runs with no copyable databases still fail. A retained scope remains its previous snapshot; this does not migrate or repair the source database.Why This Change Was Made
Keep the complete configured roster through staging, handle per-agent snapshot failures there, and pass the retained scopes explicitly to pruning. Copy only successfully staged manifests into the repository. Reuse the existing outcome error field without changing the outcome store's schema or retention. Update the Git backup documentation and shrink the assertion baseline for the removed cast.
Evidence
The existing regression drives separate real command processes with synthetic config files and SQLite databases, then checks committed Git tree hashes, CLI/JSON diagnostics, and persisted outcomes.
Before the fix, the same regression had two expected failures and one pass:
After the fix, the required suite passed:
This covers retained scopes, refreshed healthy agents, removed-agent pruning, explicit-selection and zero-copyable failures, and 256 MiB streaming backup/restore/verification. Changed-file checks passed, including core and test typechecks, lint, and storage/import guards. No live scheduled job or external backup remote was exercised; scheduler argv coverage and isolated local Git proof cover this change.
The lead's independent P1 review is scoped-clean at
62ab114da6b79cacbd34ddfee575a0af5bcacdff. The landing refresh rebased all three commits ontod363685cab9fd6c6202998216cf945c46a195904, which contains both required fixture repairs (7dc8a1e79659afb833df4bbfe363744c8d775e5cand273b6c5e114). All three range-diff entries are unchanged, and the aggregate stable patch ID is identical. The GitHub merge ref contains both fixes. No code changed during this refresh.Exact-head CI for b94044f0e533a4ebc3b28b217d1d73293853d039 passed: 101 checks passed, 44 skipped, and none failed or remained pending, including
openclaw/ci-gate. The one-hour watcher expired during runner queueing; the prescribed fallback polling confirmed green on its twelfth read. A transient API rate-limit read recovered without rerunning CI.ClawSweeper review
The completed ClawSweeper review at
b94044f0e533a4ebc3b28b217d1d73293853d039reports no actionable findings and acknowledges the accepted diagnostic follow-up. No fixups applied. The P2 combined-warning budget finding is deferred under the maintainer's explicit P1-reviewed, patch-identical landing scope: sufficiently long agent warnings can truncate the saved push diagnostic at the existing 1,200-unit limit. The independentpushFailedflag and full CLI/JSON diagnostics remain available. A follow-up should budget the combined persisted diagnostic and cover mixed degradation plus push failure. The rebase changes no code, so no re-review command is requested.