Repository navigation
fix(snapshot): preserve Git backup failure diagnostics - #135455
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs real behavior proof before merge. Reviewed September 2, 2026, 6:36 AM ET / 10:36 UTC. ClawSweeper reviewWhat this changesThe branch preserves bounded, credential-redacted stderr and stdout diagnostics for failed Git backups, records them in backup freshness state, and recognizes only an unborn branch as empty history. Merge readiness⛔ Blocked until stronger real behavior proof is added - 3 items remain The implementation is a coherent owner-local repair and the prior cap-boundary findings are addressed, but this external PR still needs inspectable real CLI proof before merge. Priority: P2 Review scores
Verification
How this fits togetherGit snapshot backups invoke Git to create, push, and inspect a repository, then record the outcome in the shared state database. The backup CLI and freshness status consume that recorded result to give operators recovery information. flowchart LR
A[Backup CLI] --> B[Git snapshot owner]
B --> C[Git command result]
C --> D[Redact and bound diagnostics]
D --> E[Backup outcome record]
D --> F[Operator CLI output]
E --> G[Freshness status]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +74, Tests +293. Total +367 across 6 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the Git-specific formatter at the snapshot owner, where redaction and the persisted backup-outcome limit meet, and attach a redacted exact-head CLI trace before merge. Do we have a high-confidence way to reproduce the issue? Yes, from source: current main's failed-push path chooses only stderr or stdout and its history path emits raw Git output. I did not execute the external contributor branch during this read-only review. Is this the best way to solve the issue? Yes. The generic formatter cannot enforce Git URL redaction before tail selection together with this backup record's 1,200-unit dual-stream limit, so the snapshot owner is the narrowest correct boundary. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against a144a7ed268f. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (9 earlier review cycles; latest 8 shown)
|
1cd70b7 to
123e63e
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review Addressed the P2 on head |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review Addressed the exact-head P2 at |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Land-ready proof for exact head
Redacted rejected-push trace: Exact CI run: https://github.com/openclaw/openclaw/actions/runs/33619708733
|
|
Thanks @ly85206559! Proof: Packaged
Landed: 4b85500 Source head: 5eb8749 |
Related: openclaw#134607 ## What Problem This Solves Git snapshot backup failures lost useful operator diagnostics. - Failed push kept stderr or stdout, but not both. - Failed history exposed raw Git errors. - Empty history depended on one English Git message. - Persisted diagnostics could split a UTF-16 surrogate pair. ## Why This Change Was Made The Git snapshot owner now formats every failed Git result through one bounded path. That path redacts each output line before it reserves space for both streams. This keeps multi-line URL query credentials from consuming later diagnostics. Unborn repositories are detected from symbolic `HEAD` and exact branch-ref state. Corrupt refs and missing non-branch refs remain visible failures. The generic process formatter is unchanged. The backup record keeps the same 1,200 UTF-16-unit storage contract. ## User Impact Operators keep recent stderr and stdout details after a failed push or history read. Diagnostics remain bounded and remove URL user information and sensitive query values. Empty repositories still show an empty history. Successful create, push, history, and restore behavior is unchanged. ## Evidence - Current main `6c0543988388bb12f47c3aedbb10e6342dbc4f6f`: real `openclaw backup git create --push` lost stdout, and corrupt `backup git log` returned raw repeated Git errors. - Repaired tree: a real rejected `git push` retained both stream tails and persisted exactly 1,200 UTF-16 units with all synthetic URL credentials removed. - Repaired tree: real unborn history returned no commits; corrupt history returned a structured redacted error; successful push, log, and restore passed against a local bare remote. - Focused tests: 59 passed across process, snapshot, state, and command owners. - Final test-audit run: 28 snapshot and persistence tests passed with an emoji placed on the actual formatter cut boundary. - Packaged CLI E2E test: real init, failed push, unborn history, and corrupt history passed through `openclaw.mjs`. - Formatting and `git diff --check` passed. ### Redacted exact-head terminal trace ```text Git backup committed: <backup-commit> Warning: Git backup committed, but push failed: git push failed (code=1, termination=exit) stderr: … stderr-old-89 https://***:***@example.invalid/backup.git?access_token=*** stderr-tail-🦞 https://***:***@example.invalid/backup.git?access_token=*** error: failed to push some refs to '<temp>/remote.git' stdout: … stdout-old-89 https://***:***@example.invalid/backup.git?access_token=*** stdout-tail-🐚 https://***:***@example.invalid/backup.git?access_token=*** PASS failed-push persisted warning length=1200 UTF-16 units TRACE freshness equals create warning: true ``` Co-authored-by: Ayaan Zaidi <[email protected]>
Related: #134607
What Problem This Solves
Git snapshot backup failures lost useful operator diagnostics.
Why This Change Was Made
The Git snapshot owner now formats every failed Git result through one bounded path.
That path redacts each output line before it reserves space for both streams. This keeps multi-line URL query credentials from consuming later diagnostics.
Unborn repositories are detected from symbolic
HEADand exact branch-ref state. Corrupt refs and missing non-branch refs remain visible failures.The generic process formatter is unchanged. The backup record keeps the same 1,200 UTF-16-unit storage contract.
User Impact
Operators keep recent stderr and stdout details after a failed push or history read.
Diagnostics remain bounded and remove URL user information and sensitive query values.
Empty repositories still show an empty history. Successful create, push, history, and restore behavior is unchanged.
Evidence
4fc24e6e0f81121cef0fb4395db29fb87700e7f6: realopenclaw backup git create --pushlost stdout, and corruptbackup git logreturned raw repeated Git errors.git pushretained both stream tails and persisted exactly 1,200 UTF-16 units with all synthetic URL credentials removed.openclaw.mjs.git diff --checkpassed.Redacted exact-head terminal trace