Skip to content

fix(backup): preserve Git failure tails through console redaction - #183448

Merged
steipete merged 1 commit into
mainfrom
steipete/fix-cli-backup-diagnostic-tail-20261025
Oct 25, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/fix-cli-backup-diagnostic-tail-20261025

Conversation

@steipete

@steipete steipete commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Git backup push failures lose their useful stderr/stdout tails in the shipped CLI when diagnostics include credential-bearing URLs. Related: #183248.

User Impact

Operators retain the Git failure reason and diagnostic tails while URL credentials remain redacted and terminal controls remain escaped. A successful local backup still succeeds when the optional push fails. JSON results and recorded diagnostics are unchanged.

Why This Change Was Made

Escaping real newlines without whitespace turns subsequent diagnostic text into part of a URL query value for console redaction. The CLI renderer now sanitizes each line and puts whitespace around escaped line breaks. Neither redactor changes. Production LOC is +3/−3 (net zero); the existing owner test gains five lines to cover the real console-redaction boundary.

Evidence

On main 3672bd28a26f, the existing shipped-CLI file reproduced 6 passed / 1 failed: keeps Git backup failures useful through the shipped CLI lost stderr-tail-🦞. Its preceding assertion confirms the push failed; Git backup committed reports the intentionally successful local commit. The added owner assertion also fails before the fix, because console redaction consumes the diagnostic labels and tail text.

Focused tests passed: 55 tests across src/commands/backup-git.test.ts, src/snapshot/git-backup.test.ts, src/snapshot/git-backup-failure.test.ts, and src/snapshot/git-backup.cleanup.test.ts; one existing Windows-only case skipped on macOS. Changed-file oxfmt, lint, and diff checks passed. One initial test preparation was invalidated by concurrent formatting and replaced with the frozen-source run; it is not product evidence.

Shipped-CLI fixed-runtime E2E: all 7 tests passed, including both diagnostic tails and all synthetic credential absence assertions. The full prerequisite runtime build passed. The configured pre-commit hook passed against the exact reviewed staged patch; its resulting tree matched the commit. Focused proof used Node 26.12.1 on macOS; PR CI supplies Linux and broad validation.

Independent subagent review (autoreview route unavailable): clean at P0–P2. The configured review helper refused the requested provider route; configuration was not changed. Simplification retained the existing rendering and redaction owners, without new state, configuration, or helpers.

These are correctness fixes, not performance claims. After deployment, a failing optional Git push should show both retained diagnostic tails without credentials or terminal control bytes. No production system was exercised. Ready for maintainer review; merging is reserved for the lead.

Final published head: b243566b240485b434d7e19d485b153ef4fd693b. The required openclaw/ci-gate is SUCCESS, and CI run 40177068369 completed successfully, including all three PostgreSQL conformance shards. No CI rerun was requested. The pre-push rebase left the tested owner and regression files byte-identical. PR remains ready and open for the lead to merge.

@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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-25T08:34:38.766367Z b243566 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation commands Command implementations size: XS 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: 🦐 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. 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: needs maintainer review before merge.

What this changes

This PR preserves Git push diagnostic tails by separating escaped newlines before console credential redaction.

Example: A rejected backup push prints a URL ending in ?access_token=*** followed by stderr-tail-🦞 and stdout-tail-🐚 on later lines.

  • Before: Console redaction can consume subsequent diagnostic labels and tails as part of the query value.
  • After: Spaces around escaped line breaks preserve both diagnostic tails while credentials remain redacted.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch is focused and source-supported, with reported shipped-CLI validation; directly inspectable after-fix runtime output is limited.
Proof confidence 🦐 gold shrimp (3/6) The ordinary contributor proof gate does not apply to this maintainer-authored PR; its body reports a macOS shipped-CLI rejected-push replay preserving both tails and excluding synthetic credentials, but supplies no raw after-fix terminal capture.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Operators lose the useful reason and stream tails when an optional Git backup push fails.
Reason: The maintainer-authored direction restores the established diagnostic contract with no new configuration, state, or competing owner.

Regression provenance

Possible regression — probable (reviewed change; failure trace). No predecessor PR is attributed.

Merge readiness

✅ Ready for maintainer review

This PR repairs a current-main diagnostic regression with a focused change; no introduced correctness or security defects were found, and CI remains pending.

Priority: P2
Reviewed head: b243566b240485b434d7e19d485b153ef4fd693b

Before merge

None.

Findings

None.

Agent review details

How this fits together

The Git backup owner supplies bounded, credential-redacted diagnostics to the backup command, which escapes terminal controls before the console applies its own redaction and emits the warning.

flowchart LR
  A[Git push failure] --> B[Backup diagnostic formatter]
  B --> C[Backup command renderer]
  C --> D[Console credential redaction]
  D --> E[Operator terminal]
  B --> F[Recorded backup outcome]
Loading

Technical review

Best possible solution:

Keep the focused rendering fix and existing redaction owners, then land through the normal exact-head CI gates.

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

The current-main sanitizer and console query matcher establish the failure path, corroborated by the linked shipped-CLI failure; no target code was executed during this review.

Is this the best way to solve the issue?

This is the smallest complete fix: preserve whitespace at the existing rendering boundary without weakening either redactor or changing stored diagnostics.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Git backup terminal warning rendering keeps the original intent (3d19561: Escape terminal controls in human-readable reports while preserving raw JSON and recorded diagnostics.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 37b4fc8 adds src/commands/backup-git.ts:163 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 37b4fc8621d9; files: src/commands/backup-git.ts)

PR surface

Source 0, Tests +5, Docs 0. Total +5 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 3 3 0
Tests 1 5 0 +5
Docs 1 1 1 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 9 4 +5

Labels

Label changes:

  • add P2: Missing failure details hinder diagnosis of optional remote backup replication, while the successful local backup remains available.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: Missing failure details hinder diagnosis of optional remote backup replication, while the successful local backup remains available.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

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.

Reviewed October 25, 2026, 4:47 AM ET / 08:47 UTC.

@steipete
steipete merged commit 97d591c into main Oct 25, 2026
138 of 140 checks passed
@steipete
steipete deleted the steipete/fix-cli-backup-diagnostic-tail-20261025 branch October 25, 2026 09:18
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XS 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