Skip to content

fix(cli): keep backup git scope guard remedies in --json error output - #199850

Merged
obviyus merged 2 commits into
openclaw:mainfrom
SunnyShu0925:fix/backup-git-scope-guards-json-remedy-417
Nov 16, 2026
Merged

obviyus merged 2 commits into
openclaw:mainfrom
SunnyShu0925:fix/backup-git-scope-guards-json-remedy-417

Conversation

@SunnyShu0925

@SunnyShu0925 SunnyShu0925 commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

openclaw backup git create --repository <repo> --json without a scope flag exits 1 with only [openclaw] The CLI command failed. and the doctor hint on stderr, so machine callers that read stderr never see the Choose at least one Git backup scope: --all, --global, or --agent <id>. remediation that the text lane already prints. The same gap affects all six scope/blank argument guards across backup git create, backup git verify, and backup git restore.

  • Problem: the six argument guards in src/commands/backup-git.ts (blank --agent element, --all combined with an explicit scope, missing create scope, blank --store, more than one single-identity scope, missing single-identity scope) throw a plain Error. The text lane renders its message, but the JSON lane classifies it as an unexpected failure and replaces stderr with the generic failure banner, leaving the remediation only inside the stdout envelope.
  • Solution: throw ExpectedCliError from the same guards via the canonical throwExpectedCliError helper, so the JSON lane renders the same remediation the text lane prints while keeping the envelope untouched.
  • What changed: src/commands/backup-git.ts routes the six guards through throwExpectedCliError (one new import, six throw call sites, identical message text). src/commands/backup-git.test.ts folds class assertions into two existing rejection tests (a per-row error-name column in the invalid-agent table — the neighboring unknown-agent guard stays a plain Error — and name: "ExpectedCliError" in the --all conflict case), net zero test lines.
  • What did NOT change: exit codes, the stdout JSON envelope shape and message, text-lane stdout/stderr bytes, happy-path backup behavior, the neighboring unknown-agent guard, and every other backup subcommand.

Why This Change Was Made

ExpectedCliError is the shipped owner for argument-level CLI failures (src/cli/expected-cli-error.ts), so the fix reuses the existing failure classifier instead of adding a rendering path. This is the same per-site conversion already merged for the sibling backup guards: #199573 (backup record), #199763 (backup create --to), and #199781 (backup verify/restore --namespace).

  • Best fix: convert the guard throws in place; the message text, exit code, and machine envelope stay byte-identical, and only the stderr classification in JSON mode changes. All six guards run before any Git work or lifecycle write custody, so no side effects move.
  • Alternative: special-case the JSON renderer to print error.message for plain Error too. Rejected: that would leak stack-y unexpected failures into the expected lane and change every other command at once.
  • Risk: the only observable delta is which stderr lines appear in JSON mode for these six invalid inputs; valid scopes, the text lane, and the stdout envelope were verified byte-identical in the shipped-build comparison below.

User Impact

Operators and CI jobs that run backup git create/verify/restore with --json now get the actionable remediation on stderr (for example Choose a Git backup scope: --global, --agent <id>, or --store <id>.), matching the text lane, instead of a generic failure banner. Scripts that parse the stdout envelope see no change.

Compatibility

  • Preserved: exit codes, stdout envelope bytes, text-lane bytes, and non-guard failures are unchanged (all cmp-verified below).
  • Related: fix(backup): snapshot the canonical agent session database for --agent (#159228) #161230 also touches src/commands/backup-git.ts, but it changes which agent database a snapshot captures (import rename plus the post-guard database resolution and happy-path tests); it does not touch these six guard throws or the two rejection tests folded here. The changes are complementary — whichever merges first, the other needs only a mechanical rebase.
  • Not claimed: no behavior change for valid scope selections, no Windows or macOS run.

Evidence

Both arms were built with the shipped CLI pipeline (node --import ./scripts/tsx.mjs scripts/build-all.mts cliStartup) and exercised through the real launcher (node openclaw.mjs <cmd>) with env -i and a fresh chmod-700 scratch HOME / XDG_RUNTIME_DIR / OPENCLAW_STATE_DIR per cell — no gateway, no credentials, no mocks. --version self-reports both arm identities: base OpenClaw 2026.11.3 (e693b33), this head OpenClaw 2026.11.3 (6eb8f16). The final runtime-postbuild metadata phase fails identically on both arms on a dangling plugin-dependency symlink in the build host's shared checkout (pre-existing environment issue); the launcher and every cell below run on the produced dist.

Case (backup git ..., all with --repository <repo>) Before (origin/main e693b33) After (this head 6eb8f16)
create --agent " " --json exit 1; stderr only the generic pair (208 B); remedy confined to the stdout envelope (104 B) exit 1; stderr --agent must not be blank; stdout envelope byte-identical (104 B)
create --all --global --json exit 1; same generic stderr pair; remedy only in envelope (149 B) exit 1; stderr Use --all by itself, or select --global and --agent scopes explicitly.; envelope byte-identical (149 B)
create --json (no scope) exit 1; same generic stderr pair; remedy only in envelope (150 B) exit 1; stderr Choose at least one Git backup scope: --all, --global, or --agent <id>.; envelope byte-identical (150 B)
verify --store " " --json exit 1; same generic stderr pair; remedy only in envelope (104 B) exit 1; stderr --store must not be blank; envelope byte-identical (104 B)
verify --global --agent main --json exit 1; same generic stderr pair; remedy only in envelope (156 B) exit 1; stderr Choose exactly one Git backup scope: --global, --agent <id>, or --store <id>.; envelope byte-identical (156 B)
verify --json (no scope) exit 1; same generic stderr pair; remedy only in envelope (146 B) exit 1; stderr Choose a Git backup scope: --global, --agent <id>, or --store <id>.; envelope byte-identical (146 B)
text lane, all six invalid inputs (no --json) exit 1; stderr carries the remedy exit 1; stdout and stderr byte-identical to before (cmp reports no difference on all six)
control: backup verify <missing-archive> --json (non-guard failure) exit 1; generic stderr pair; 235 B envelope exit 1; stdout and stderr byte-identical (cmp); generic pair retained
control: backup verify <missing-archive> --namespace probe --json (sibling guard converted by #199781) exit 1; stderr --namespace requires --from <location>. exit 1; stdout and stderr byte-identical (cmp); remedy retained, no generic banner

Pre-fix JSON lane (base build, representative cell):

$ node openclaw.mjs backup git create --repository /tmp/417-probe-repo --json
# exit=1
# stderr:
[openclaw] The CLI command failed.
[openclaw] For help, run `openclaw doctor`.
[openclaw] log file append failed; records dropped; check that the path is a writable regular file; file=openclaw-2026-11-16.log
# stdout:
{
  "ok": false,
  "error": {
    "type": "cli_error",
    "message": "Choose at least one Git backup scope: --all, --global, or --agent <id>."
  }
}

Post-fix JSON lane (this head build, identical command):

$ node openclaw.mjs backup git create --repository /tmp/417-probe-repo --json
# exit=1
# stderr:
Choose at least one Git backup scope: --all, --global, or --agent <id>.
[openclaw] log file append failed; records dropped; check that the path is a writable regular file; file=openclaw-2026-11-16.log
# stdout: byte-identical to the base envelope above (cmp)

The log file append failed line is scratch-environment noise emitted identically by both arms in every cell; it is included in all byte counts and cmp comparisons.

Invariants across the two builds (104 automated checks, all passing):

six JSON guard cells stdout (envelope)      : byte-identical, exit 1 on both arms
six JSON guard cells stderr                 : generic pair replaced by the single guard message
six text-lane cells (stdout and stderr)     : byte-identical
control A (non-guard failure), both lanes   : byte-identical; JSON keeps the generic pair,
                                              text keeps the real archive-missing message
control B (--namespace sibling guard), both : byte-identical; remedy on stderr, no generic banner

Reachability was verified on the base arm with OPENCLAW_DEBUG=1 (the plain Error prints a stack; the expected error does not). Frame excerpt, paths shortened to dist-relative:

[openclaw] Error: Choose at least one Git backup scope: --all, --global, or --agent <id>.
[openclaw]     at resolveCreateDatabases (dist/backup-git-BNh8CDrm.mjs:25:475)
[openclaw]     at backupGitCreateCommand (dist/backup-git-BNh8CDrm.mjs:25:2119)
[openclaw]     at dist/register.backup-DmcjqL9g.mjs:3:8420
[openclaw]     at async runCommandWithRuntime (dist/cli-utils-Cz2q-7HD.mjs:3:233)

The verify no-scope cell shows the analogous resolveOneIdentity frame. Serialized shipped bundles of the changed owner prove the executed form on each arm:

// base dist/backup-git-BNh8CDrm.mjs
if(!e.all&&!n)throw new Error(`Choose at least one Git backup scope: --all, --global, or --agent <id>.`);
// this head dist/backup-git-Mi6yxXq9.mjs
import{n as throwExpectedCliError}from"./expected-cli-error-oDVmXYil.mjs";
if(!e.all&&!n)throwExpectedCliError(`Choose at least one Git backup scope: --all, --global, or --agent <id>.`);

The folded regression assertions are red against the frozen pre-fix owner (detached base worktree, production untouched) and green on this head:

# pre-fix owner, folded assertions kept
$ vitest run --config test/vitest/vitest.commands.config.ts backup-git.test.ts
 FAIL  rejects an whitespace-only Git create agent
 AssertionError: expected Error: --agent must not be blank to match object { name: 'ExpectedCliError', …(1) }
 FAIL  keeps the --all plus explicit-scope conflict ahead of agent validation
 AssertionError: expected Error: Use --all by itself, or select --g… to match object { name: 'ExpectedCliError', …(1) }
 Tests  2 failed | 17 passed (19)

# this head
$ vitest run --config test/vitest/vitest.commands.config.ts backup-git.test.ts
 Test Files  1 passed (1)
 Tests  19 passed (19)

The unknown-agent row of the same table asserts name: "Error" and passes on both arms, pinning that the neighboring guard (a different owner) is not over-converted.

What was not tested: no Windows or macOS run; backup git restore shares the resolveOneIdentity owner with verify and was not driven separately; commander-level missing-value rejections happen before the owner and are not exercised. Both arms' builds fail identically in the final runtime-postbuild metadata phase on the shared checkout's dangling plugin-dependency symlink (environment, pre-existing); the check-cli-bootstrap-imports guard passed on both arms.

Open PR collision check: on the day of writing, the full open-PR list (3611 PRs) was scanned by changed-file list (GraphQL for the newest 1100, REST per-PR files for the remainder; four empty-diff PRs verified individually). Only #161230 touches src/commands/backup-git.ts / backup-git.test.ts; its hunks (canonical agent-database selection for --agent snapshots) do not intersect the six guard throws or the two folded rejection cases, so it is complementary, not a duplicate (see Compatibility). Same-family merges this week are per-site siblings (#199573, #199763, #199781); none covers the backup git scope guards.

Maintainer validation

Validated 501efb5896f447a998a51963feb031a985c6d4db: twice-per-side real CLI scope guards, byte-identical text/JSON/exit controls, unchanged unknown-agent errors, regression, typecheck and packed-install receipts. The contributor production fix is unchanged. The added commit only makes an existing external-root fixture independent of the macOS /tmp alias; no case was removed and test growth remains zero.

Merge danger: reversible error-classification/test-fixture change. Blast radius: JSON stderr presentation for six local Git backup scope guards.

@clawsweeper

clawsweeper Bot commented Nov 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.

@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations size: XS labels Nov 15, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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. labels Nov 15, 2026
@clawsweeper

clawsweeper Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

The PR classifies six Git backup argument errors as expected failures so JSON-mode stderr includes their existing remedies.

Example: Run openclaw backup git create --repository /tmp/backup-repo --json without a scope.

  • Before: Stderr prints a generic failure and Doctor hint; the scope remedy appears only in JSON stdout.
  • After: Stderr prints Choose at least one Git backup scope: --all, --global, or --agent &lt;id>.; JSON stdout and exit code 1 remain unchanged.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A minimal, useful repair with real CLI proof, red/green regression evidence, and no identified correctness defect; exact-head CI is still completing.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The body supplies built-launcher before/after output, and obviyus repeats all six guard scenarios through the real CLI at the final head with isolated state, unchanged-output controls, and no created backup artifacts; the final commit changes only fixture paths, and no persisted data format or migration changes.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Invalid Git backup scopes produce an unhelpful generic stderr failure in JSON mode.
Reason: The narrow repair follows the established expected-error contract and has explicit final-head validation from collaborator obviyus.

Merge readiness

✅ Ready for maintainer review

This PR fixes a confirmed CLI diagnostic defect still present on current main; the focused implementation has sufficient behavior proof and no actionable findings.

Priority: P3
Reviewed head: 501efb5896f447a998a51963feb031a985c6d4db

Before merge

None.

Findings

None.

Agent review details

How this fits together

Git backup command handlers validate CLI scopes before invoking backup operations; the shared CLI renderer turns their errors into stderr diagnostics and JSON failure envelopes.

flowchart TD
  A[Backup CLI arguments] --> B[Git scope validation]
  B --> C[Expected CLI error]
  C --> D[Shared failure renderer]
  D --> E[Actionable stderr]
  D --> F[JSON stdout envelope]
  B --> G[Valid backup operation]
Loading

Technical review

Best possible solution:

Retain the six in-place classifier conversions and the portable fixture correction, using the existing shared renderer.

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

Current-main source traces these plain errors through the generic JSON-mode stderr renderer, and supplied real CLI comparisons demonstrate the failure; this read-only review ran no target code.

Is this the best way to solve the issue?

The patch fixes classification at the producing guards, preserving validation and output contracts without adding another rendering path; existing tests gain relevant assertions without new scaffolding.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Create scope and conflict guards keeps the original intent (37b4fc8: Versioned Git backups required explicit scope selection and rejected mixing --all with explicit scopes.)
  • Blank agent rejection keeps the original intent (46dcc57: Operator selectors must reject invalid agents before dispatching work.)
  • Verify and restore store guards keeps the original intent (b7bb85a: PostgreSQL and plugin-store restoration introduced explicit store identities with exactly one selected scope.)
  • External configured-agent-root fixture keeps the original intent (2f17d11: Backups must preserve configured agent roots outside the default state layout; cwd-based absolute fixture paths retain that scenario while avoiding the reported macOS temporary-directory alias.)

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:50 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)
  • Ayaan Zaidi: Raw commit 2d2b465 adds src/commands/backup-git.ts:1 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 2d2b4658943d; files: src/commands/backup-git.ts)

PR surface

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

View PR surface stats
Area Files Added Removed Net
Source 1 9 6 +3
Tests 1 10 10 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 19 16 +3

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.

Label justifications:

  • P3: This improves diagnostics for invalid advanced CLI inputs; JSON stdout already contains the remedy and valid backup operations are unaffected.
  • 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 (1 earlier review cycle)
  • reviewed 2026-11-16T00:03:05.169Z sha 6eb8f16 :: needs maintainer review before merge. :: none

Reviewed November 15, 2026, 7:53 PM ET / November 16, 2026, 00:53 UTC (Revision 2).

@obviyus

obviyus commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

Validated final head 501efb5896f447a998a51963feb031a985c6d4db against main baseline e693b3323e90. SunnyShu's production fix is retained. No test case was removed.

Repeated production-path proof

Tier: source, host through ocx src on the pinned Bun fork. Each side had an isolated HOME/state/config, with the same profile name (p199850proof) for comparable diagnostics. No Gateway was started. Every command used a distinct task-owned, initially absent --repository; restore also received an initially absent --target.

Each row was exercised twice on main and twice on candidate, in both JSON and text modes:

User input after backup git Existing message restored on JSON stderr
create with no scope Choose at least one Git backup scope: --all, --global, or --agent <id>.
create --all --global Use --all by itself, or select --global and --agent scopes explicitly.
create --agent ' ' --agent must not be blank
verify --store ' ' --store must not be blank
verify --global --agent main Choose exactly one Git backup scope: --global, --agent <id>, or --store <id>.
restore --target <private-path> with no scope Choose a Git backup scope: --global, --agent <id>, or --store <id>.

Main JSON stderr showed the generic failure and Doctor hint for every row:

[openclaw] The CLI command failed.
[openclaw] For help, run `openclaw --profile p199850proof doctor`.

Candidate JSON stderr instead contained exactly the corresponding existing message above. For every repetition, text-mode stderr was byte-identical before/after; JSON and text stdout were byte-identical; every exit code stayed 1. No repository or restore target was created.

Unknown-agent control

backup git create --agent nope-agent was also run twice per side in both modes. Its JSON stderr retained the same generic failure/Doctor hint; text mode retained the unknown-agent message. Stdout and exit 1 were byte-identical. The regression explicitly keeps this error's name Error, not ExpectedCliError.

That is 28 real CLI invocations per side, including controls, with all stdout/stderr/exit comparisons passing. Banner suppression and no-color mode excluded unrelated presentation noise; CLI validation and normal failure rendering were not mocked.

Selected identical stdout SHA-256 receipts (both repetitions, both sides):

  • Create/no scope JSON: ea80e9e388868bc7e07954b9b1b8422511c20190efb847791e3443adfc8607e5.
  • Verify/blank store JSON: 43f69c101a8b1f22324f3be9ad8fbbc6f6fb82ab66f55810036025683d091309.
  • Verify/multiple scopes JSON: b6bb466e60975e975ca1cd4eaa7ec6397128e61c7e89155a46912cedb2c6946c.
  • Restore/no scope JSON: d013ad5e08c36decf129dd94158c48cf563d7a50f0ae5cbed4844b830f0a055d.
  • Unknown-agent JSON control: dde47bc54cfd374d6ccf38ab814f67e0c508404bf85ead381925f05717457d7c.

Focused regression and fixture correction

The initial baseline test run exposed an existing fixture portability failure: /tmp/external-* was expected literally while macOS normalized it to /private/tmp/external-*. The fixture now uses absolute cwd-based external agent roots instead, still outside the isolated state directory. This preserves the configured-root scenario and avoids a platform-specific path alias; no production path handling changed.

With the identical corrected fixture on both sides: candidate 19 passed; baseline 2 failed / 17 passed, exactly the missing expected-error classifications. The unknown-agent case stayed green on the baseline. The baseline test command took 42.11 seconds; the candidate test/typecheck/format sequence took 59.54 seconds.

Matching typecheck leaf test/tsconfig/tsconfig.core.test.commands.json and targeted Oxfmt checks passed under ocx. No new selection rule, Git/database operation, credential handling, runtime message text or public API was introduced.

Merge danger: reversible error-classification/test-fixture change. Blast radius: JSON stderr presentation for the six local Git backup scope guards.

Full package and final scope

  • full, host: ocx build --dts passed (157 seconds), including all 163 public Plugin SDK declaration subpaths. The supported core source-package builder checked the tarball; a fresh isolated npm install passed the installed CLI --version and backup git create --help smoke at 501efb5.
  • Final host-ocx eligibility passed: only src/commands/backup-git.ts and its test changed. No package, lockfile, workspace, install, script or hook inputs changed.
  • Whole-PR delta: production +9/-6, tests +10/-10 (net 0), no allocation file. The only added commit changes the two fixture paths; no production behavior beyond the contributor fix was changed.
  • Worktrunk creation and commit/push hooks were disabled. The normal ocx dependency-install lifecycle did run scripts/prepare-git-hooks.mjs; no hook approval or dependency update was performed.

Hosted gates on the final head

  • CI run 43782496914, attempt 2: success, 0 cancelled CI jobs.
  • openclaw/ci-gate: success — “CI and applicable security review requirements passed.” Security-sensitive review also passed: “No sensitive product changes.”
  • ClawSweeper review: exact head 501efb5896f447a998a51963feb031a985c6d4db, ready, 5/5/5, no actionable findings.

@obviyus

obviyus commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Nov 16, 2026
@obviyus
obviyus merged commit ef35477 into openclaw:main Nov 16, 2026
121 of 122 checks passed
@obviyus

obviyus commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator

Landed in ef35477. Thanks @SunnyShu0925.

@SunnyShu0925

Copy link
Copy Markdown
Contributor Author

@obviyus Thanks!

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 16, 2026
…openclaw#199850)

fix(cli): report backup git scope errors through the expected-error path

`openclaw backup git create`, `verify` and `restore` with `--json` threw plain errors for their scope checks (a blank `--agent` or `--store`, `--all` combined with explicit scopes, no scope, or more than one scope), so `--json` stderr showed the generic failure plus the Doctor hint instead of the existing message. These checks run before the repository or any database is touched and now use the expected-error path with the same messages. An unknown agent ID stays a plain error. No new text.

Evidence: host, isolated state, no Gateway. Source CLI, twice per side, with --json and in text mode (28 calls per side): `backup git create --repository <tmp>` with no scope, with `--all --global` and with `--agent ' '`; `backup git verify --repository <tmp> --store ' '`; `backup git verify --repository <tmp> --global --agent main`; and `backup git restore --repository <tmp> --target <tmp2>` with no scope. Base prints the generic failure and Doctor hint, this change prints the existing message; text-mode stderr is byte-identical, JSON stdout and exit codes match, an unknown --agent stays a plain error on both, and no repository or restore target is created. Vitest-source: two cases fail on base, 19 pass here; typecheck, full build and packed smoke pass. Receipts: openclaw#199850 (comment).

Thanks @SunnyShu0925.

Co-authored-by: Ayaan Zaidi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. 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.

2 participants