Skip to content

fix(cli): surface sandbox explain blank --agent remedy in --json failures - #199369

Merged
obviyus merged 2 commits into
openclaw:mainfrom
SunnyShu0925:fix/bug-420-sandbox-explain-json-remedy
Nov 15, 2026
Merged

obviyus merged 2 commits into
openclaw:mainfrom
SunnyShu0925:fix/bug-420-sandbox-explain-json-remedy

Conversation

@SunnyShu0925

@SunnyShu0925 SunnyShu0925 commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

openclaw sandbox explain --agent " " --json prints a generic failure and Doctor hint on stderr instead of the existing --agent must not be blank remedy. The JSON envelope already contains the correct message.

Solution

Use the existing throwExpectedCliError helper at the blank-agent guard. No message text changes. Unknown-agent rejection, text-mode output, JSON envelope bytes and exit codes remain unchanged.

SunnyShu0925's original fix commit is retained. The additional test-only commit compacts the existing rejection table, checks the error name and message in one command invocation, and exercises whitespace input. Production +2/-1; tests +6/-6; no allocation file.

Evidence

Exact head: 54fe23bdab7374e2ed2c15320ccc3ec2fb9a1bff.

  • Before/after source CLI receipts: isolated profile/HOME/state/config, base once and candidate once. JSON-mode stderr now shows the existing remedy; stdout is byte-identical. Text mode and valid-agent output are identical; exit codes unchanged.
  • Full build, packed launcher and final regression receipts: full declaration build passed; tarball integrity/import graph passed; extracted packed launcher returned the exact-head version. Existing external dependencies were reused, not freshly installed.
  • Vitest-source: full file 20/20 on candidate; base failed only blank-agent classification. Final compacted rejection cases: 2/2 candidate, 1/2 base, with the expected Error/ExpectedCliError mismatch.
  • Formatting passed. Targeted lint timed out waiting for checkout ownership during packaging; no lint success claimed.

The diff touches only the command and its existing test, so the host-ocx isolation check passed. No host git hook ran. No Gateway or sandbox backend is needed: the guard rejects before those paths.

Risk

Two-way door: reverting changes no stored state or public API. Blast radius is the stderr classification of explicitly blank sandbox explain --agent input; the original rejection and wording are preserved.

@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 docker Docker and sandbox tooling 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: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: ⏳ waiting on maintainer Only explicit maintainer approvals or decisions remain; merge is still blocked. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Nov 15, 2026
@clawsweeper

clawsweeper Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR makes sandbox explain show the existing blank-agent remedy on stderr when JSON output is enabled.

Example: Run openclaw sandbox explain --agent " " --json.

  • Before: Stderr shows a generic command failure and Doctor hint.
  • After: Stderr shows --agent must not be blank; the JSON error envelope and exit code 1 stay unchanged.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A focused repair using the existing owner, supported by actual CLI comparisons and a base-failing regression; remaining CI is routine validation.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The supplied isolated CLI trace exercises the changed blank-agent guard and root renderer, shows the corrected stderr remedy, and verifies unchanged JSON bytes, text-mode output, valid-agent output and exit codes; the final commit changes only test scaffolding.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: A blank agent argument produces an unrelated Doctor hint on stderr in JSON mode instead of the specific argument remedy.
Reason: The narrow classification repair restores the established expected-error behavior without new options, defaults or state.

Merge readiness

✅ Ready for maintainer review

This PR fixes a current CLI diagnostic bug with a minimal change and convincing before/after proof; no actionable defects were found, and current-head CI is still running.

Priority: P3
Reviewed head: 54fe23bdab7374e2ed2c15320ccc3ec2fb9a1bff

Before merge

None.

Findings

None.

Agent review details

How this fits together

The sandbox CLI forwards agent options to sandboxExplainCommand, whose validation errors pass through the command runtime to the root renderer for stderr diagnostics and JSON error output.

flowchart TD
  A[CLI arguments] --> B[Sandbox command registration]
  B --> C[Agent argument validation]
  C --> D[Expected CLI error]
  D --> E[Root failure renderer]
  E --> F[Stderr remedy]
  E --> G[JSON error envelope]
Loading

Technical review

Best possible solution:

Use the existing expected-error helper at the blank-agent guard while preserving validation, message text, JSON output and exit status.

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

Current-main source exposes the plain-error rendering path, and obviyus supplied a matching base-versus-candidate CLI trace; this read-only review ran no target code.

Is this the best way to solve the issue?

The patch is the smallest complete fix: classify the known argument error at its producer and reuse the existing renderer, with the regression consolidated into the existing rejection table.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Explicit-agent validation keeps the original intent (46dcc57: Reject blank or unconfigured explicit agent selectors rather than silently inspect an invented agent.)
  • Expected-error classification keeps the original intent (bc097bf: Preserve specific operator-facing remedies through the root CLI renderer using a dependency-light error owner.)
  • Existing rejection-test consolidation keeps the original intent (a489782: Reduce repeated test scaffolding while retaining distinct current-main regressions.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 46dcc57 adds src/commands/sandbox-explain.ts:149 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 46dcc57c5498; files: src/commands/sandbox-explain.ts)
  • Jerome: Raw commit bc097bf adds src/cli/expected-cli-error.ts:28 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: bc097bf6404f; files: src/cli/expected-cli-error.ts)
  • Nikolas Sapalidis: Raw commit c232d50 adds src/commands/sandbox-explain.ts:47 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: c232d50420bd; files: src/commands/sandbox-explain.ts)

PR surface

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

View PR surface stats
Area Files Added Removed Net
Source 1 2 1 +1
Tests 1 6 6 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 8 7 +1

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 status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove status: ⏳ waiting on maintainer: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P3: This improves a diagnostic for invalid input in an advanced CLI workflow; valid commands and machine-readable error output already work.
  • 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-15T01:54:58.038Z sha 88b60af :: blocked before merge. :: none

Reviewed November 14, 2026, 9:47 PM ET / November 15, 2026, 02:47 UTC (Revision 2).

@obviyus

obviyus commented Nov 15, 2026

Copy link
Copy Markdown
Collaborator

Verified the blank-agent fix through the actual CLI. No message text changes.

Host isolation check: the merge-base diff contains only src/commands/sandbox-explain.ts and its existing test. No package, lockfile, workspace, npm config, patch, script or hook changes; all checks ran on the host through ocx, with isolated HOME/state/config and profile p199369. No host git hook ran.

Source tier (ocx selected Node + tsx): base d3438ec and candidate use the same fixture and commands:

sandbox explain --agent " " --json
base stderr:
[openclaw] The CLI command failed.
[openclaw] For help, run `openclaw --profile p199369 doctor`.
candidate stderr:
--agent must not be blank
both exit 1; stdout byte-identical:
{
  "ok": false,
  "error": {
    "type": "cli_error",
    "message": "--agent must not be blank"
  }
}

sandbox explain --agent " "
both stderr: --agent must not be blank
both stdout empty; both exit 1

sandbox explain --agent main --json
both exit 0; stdout byte-identical

The CLI registration passes the --agent and --json options unchanged into sandboxExplainCommand. runCommandWithRuntime rethrows JSON-mode failures; the root renderer distinguishes the existing ExpectedCliError. The changed line only classifies the existing message.

Vitest-source: the full existing suite passed 20/20 on candidate; the same regression on base failed only the blank-agent case (19 passed). Compaction retains both unknown-agent and whitespace-agent rejection coverage without calling the command twice. Production +2/-1; tests +6/-6; no allocation file. Contributor commit retained.

@obviyus

obviyus commented Nov 15, 2026

Copy link
Copy Markdown
Collaborator

Exact-head proof: 54fe23b.

Full tier on host through ocx: ocx build --dts passed (306s, declarations included). Packed tarball inventory, bundled workspace dependency checks and dist import graph passed. The extracted tarball launcher, using existing installed external dependencies and its own bundled workspace dependencies, returned OpenClaw 2026.11.3 (54fe23b) with exit 0. This is not a fresh dependency-install proof. The first smoke harness placed the dependency link inside the existing bundled directory; correcting that harness preserved bundled dependencies and passed.

Final compacted regression: candidate 2 passed/18 skipped; base 1 failed/1 passed/18 skipped. The only failure was blank-agent Error versus ExpectedCliError. Earlier full-file run passed 20/20 on candidate. Formatting passed. Targeted lint did not complete: the wrapper waited for checkout ownership during packaging and timed out; no lint success claimed.

No production code changed during compaction. Source +2/-1, tests +6/-6, no allocation. SunnyShu0925's original commit is retained; the additional commit only compacts the existing table and removes its duplicate command invocation. No git hook ran. Task-owned base, HOME/state/config directories and extracted packages were removed.

@obviyus

obviyus commented Nov 15, 2026

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 15, 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. 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. status: ⏳ waiting on maintainer Only explicit maintainer approvals or decisions remain; merge is still blocked. labels Nov 15, 2026
@obviyus
obviyus merged commit 6695768 into openclaw:main Nov 15, 2026
126 checks passed
@obviyus

obviyus commented Nov 15, 2026

Copy link
Copy Markdown
Collaborator

Landed in 6695768. Thanks @SunnyShu0925.

github-actions Bot pushed a commit to SebbeBengtsonSebbeBengtson1528/openclaw that referenced this pull request Nov 15, 2026
…ures (#199369)

fix(cli): show the blank --agent error for sandbox explain --json

`openclaw sandbox explain --agent " " --json` threw its blank-agent check as a plain error, so the JSON failure printed only "The CLI command failed." and the doctor hint instead of the existing "--agent must not be blank". It now throws the same message through the existing expected-CLI-error path, as `models` and the channel selectors do. Text mode, exit codes and valid-agent output are unchanged. No new text.

Evidence: source tier with an isolated profile. With --json, base's stderr had only the generic failure and the doctor hint; this change prints the existing message, with JSON bytes and exit code unchanged. Text mode and a valid --agent give the same output on both. Vitest-source: the regression fails on base and passes here; full build and packed launcher pass. Net 0 test lines. Receipts: openclaw/openclaw#199369 (comment).

Thanks @SunnyShu0925.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to yun7764285/openclaw that referenced this pull request Nov 15, 2026
…ures (#199369)

fix(cli): show the blank --agent error for sandbox explain --json

`openclaw sandbox explain --agent " " --json` threw its blank-agent check as a plain error, so the JSON failure printed only "The CLI command failed." and the doctor hint instead of the existing "--agent must not be blank". It now throws the same message through the existing expected-CLI-error path, as `models` and the channel selectors do. Text mode, exit codes and valid-agent output are unchanged. No new text.

Evidence: source tier with an isolated profile. With --json, base's stderr had only the generic failure and the doctor hint; this change prints the existing message, with JSON bytes and exit code unchanged. Text mode and a valid --agent give the same output on both. Vitest-source: the regression fails on base and passes here; full build and packed launcher pass. Net 0 test lines. Receipts: openclaw/openclaw#199369 (comment).

Thanks @SunnyShu0925.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to jonasbkk1188/openclaw that referenced this pull request Nov 15, 2026
…ures (#199369)

fix(cli): show the blank --agent error for sandbox explain --json

`openclaw sandbox explain --agent " " --json` threw its blank-agent check as a plain error, so the JSON failure printed only "The CLI command failed." and the doctor hint instead of the existing "--agent must not be blank". It now throws the same message through the existing expected-CLI-error path, as `models` and the channel selectors do. Text mode, exit codes and valid-agent output are unchanged. No new text.

Evidence: source tier with an isolated profile. With --json, base's stderr had only the generic failure and the doctor hint; this change prints the existing message, with JSON bytes and exit code unchanged. Text mode and a valid --agent give the same output on both. Vitest-source: the regression fails on base and passes here; full build and packed launcher pass. Net 0 test lines. Receipts: openclaw/openclaw#199369 (comment).

Thanks @SunnyShu0925.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to tbohda2025/openclaw that referenced this pull request Nov 15, 2026
…ures (#199369)

fix(cli): show the blank --agent error for sandbox explain --json

`openclaw sandbox explain --agent " " --json` threw its blank-agent check as a plain error, so the JSON failure printed only "The CLI command failed." and the doctor hint instead of the existing "--agent must not be blank". It now throws the same message through the existing expected-CLI-error path, as `models` and the channel selectors do. Text mode, exit codes and valid-agent output are unchanged. No new text.

Evidence: source tier with an isolated profile. With --json, base's stderr had only the generic failure and the doctor hint; this change prints the existing message, with JSON bytes and exit code unchanged. Text mode and a valid --agent give the same output on both. Vitest-source: the regression fails on base and passes here; full build and packed launcher pass. Net 0 test lines. Receipts: openclaw/openclaw#199369 (comment).

Thanks @SunnyShu0925.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Chulixx162Chulixx1622624/openclaw that referenced this pull request Nov 15, 2026
…ures (#199369)

fix(cli): show the blank --agent error for sandbox explain --json

`openclaw sandbox explain --agent " " --json` threw its blank-agent check as a plain error, so the JSON failure printed only "The CLI command failed." and the doctor hint instead of the existing "--agent must not be blank". It now throws the same message through the existing expected-CLI-error path, as `models` and the channel selectors do. Text mode, exit codes and valid-agent output are unchanged. No new text.

Evidence: source tier with an isolated profile. With --json, base's stderr had only the generic failure and the doctor hint; this change prints the existing message, with JSON bytes and exit code unchanged. Text mode and a valid --agent give the same output on both. Vitest-source: the regression fails on base and passes here; full build and packed launcher pass. Net 0 test lines. Receipts: openclaw/openclaw#199369 (comment).

Thanks @SunnyShu0925.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to nockxgj-ai/openclaw that referenced this pull request Nov 15, 2026
…ures (#199369)

fix(cli): show the blank --agent error for sandbox explain --json

`openclaw sandbox explain --agent " " --json` threw its blank-agent check as a plain error, so the JSON failure printed only "The CLI command failed." and the doctor hint instead of the existing "--agent must not be blank". It now throws the same message through the existing expected-CLI-error path, as `models` and the channel selectors do. Text mode, exit codes and valid-agent output are unchanged. No new text.

Evidence: source tier with an isolated profile. With --json, base's stderr had only the generic failure and the doctor hint; this change prints the existing message, with JSON bytes and exit code unchanged. Text mode and a valid --agent give the same output on both. Vitest-source: the regression fails on base and passes here; full build and packed launcher pass. Net 0 test lines. Receipts: openclaw/openclaw#199369 (comment).

Thanks @SunnyShu0925.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to flashdropperflashdropper536/openclaw that referenced this pull request Nov 15, 2026
…ures (#199369)

fix(cli): show the blank --agent error for sandbox explain --json

`openclaw sandbox explain --agent " " --json` threw its blank-agent check as a plain error, so the JSON failure printed only "The CLI command failed." and the doctor hint instead of the existing "--agent must not be blank". It now throws the same message through the existing expected-CLI-error path, as `models` and the channel selectors do. Text mode, exit codes and valid-agent output are unchanged. No new text.

Evidence: source tier with an isolated profile. With --json, base's stderr had only the generic failure and the doctor hint; this change prints the existing message, with JSON bytes and exit code unchanged. Text mode and a valid --agent give the same output on both. Vitest-source: the regression fails on base and passes here; full build and packed launcher pass. Net 0 test lines. Receipts: openclaw/openclaw#199369 (comment).

Thanks @SunnyShu0925.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to u2022Ljw/openclaw that referenced this pull request Nov 15, 2026
…ures (#199369)

fix(cli): show the blank --agent error for sandbox explain --json

`openclaw sandbox explain --agent " " --json` threw its blank-agent check as a plain error, so the JSON failure printed only "The CLI command failed." and the doctor hint instead of the existing "--agent must not be blank". It now throws the same message through the existing expected-CLI-error path, as `models` and the channel selectors do. Text mode, exit codes and valid-agent output are unchanged. No new text.

Evidence: source tier with an isolated profile. With --json, base's stderr had only the generic failure and the doctor hint; this change prints the existing message, with JSON bytes and exit code unchanged. Text mode and a valid --agent give the same output on both. Vitest-source: the regression fails on base and passes here; full build and packed launcher pass. Net 0 test lines. Receipts: openclaw/openclaw#199369 (comment).

Thanks @SunnyShu0925.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to jperejil8047/openclaw that referenced this pull request Nov 15, 2026
…ures (#199369)

fix(cli): show the blank --agent error for sandbox explain --json

`openclaw sandbox explain --agent " " --json` threw its blank-agent check as a plain error, so the JSON failure printed only "The CLI command failed." and the doctor hint instead of the existing "--agent must not be blank". It now throws the same message through the existing expected-CLI-error path, as `models` and the channel selectors do. Text mode, exit codes and valid-agent output are unchanged. No new text.

Evidence: source tier with an isolated profile. With --json, base's stderr had only the generic failure and the doctor hint; this change prints the existing message, with JSON bytes and exit code unchanged. Text mode and a valid --agent give the same output on both. Vitest-source: the regression fails on base and passes here; full build and packed launcher pass. Net 0 test lines. Receipts: openclaw/openclaw#199369 (comment).

Thanks @SunnyShu0925.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Pauline20bPauline20b5207/openclaw that referenced this pull request Nov 15, 2026
…ures (#199369)

fix(cli): show the blank --agent error for sandbox explain --json

`openclaw sandbox explain --agent " " --json` threw its blank-agent check as a plain error, so the JSON failure printed only "The CLI command failed." and the doctor hint instead of the existing "--agent must not be blank". It now throws the same message through the existing expected-CLI-error path, as `models` and the channel selectors do. Text mode, exit codes and valid-agent output are unchanged. No new text.

Evidence: source tier with an isolated profile. With --json, base's stderr had only the generic failure and the doctor hint; this change prints the existing message, with JSON bytes and exit code unchanged. Text mode and a valid --agent give the same output on both. Vitest-source: the regression fails on base and passes here; full build and packed launcher pass. Net 0 test lines. Receipts: openclaw/openclaw#199369 (comment).

Thanks @SunnyShu0925.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to HasmukhJain1414HasmukhJain141433/openclaw that referenced this pull request Nov 15, 2026
…ures (#199369)

fix(cli): show the blank --agent error for sandbox explain --json

`openclaw sandbox explain --agent " " --json` threw its blank-agent check as a plain error, so the JSON failure printed only "The CLI command failed." and the doctor hint instead of the existing "--agent must not be blank". It now throws the same message through the existing expected-CLI-error path, as `models` and the channel selectors do. Text mode, exit codes and valid-agent output are unchanged. No new text.

Evidence: source tier with an isolated profile. With --json, base's stderr had only the generic failure and the doctor hint; this change prints the existing message, with JSON bytes and exit code unchanged. Text mode and a valid --agent give the same output on both. Vitest-source: the regression fails on base and passes here; full build and packed launcher pass. Net 0 test lines. Receipts: openclaw/openclaw#199369 (comment).

Thanks @SunnyShu0925.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to NehaChoudhary6NehaChoudhary69104/openclaw that referenced this pull request Nov 15, 2026
…ures (#199369)

fix(cli): show the blank --agent error for sandbox explain --json

`openclaw sandbox explain --agent " " --json` threw its blank-agent check as a plain error, so the JSON failure printed only "The CLI command failed." and the doctor hint instead of the existing "--agent must not be blank". It now throws the same message through the existing expected-CLI-error path, as `models` and the channel selectors do. Text mode, exit codes and valid-agent output are unchanged. No new text.

Evidence: source tier with an isolated profile. With --json, base's stderr had only the generic failure and the doctor hint; this change prints the existing message, with JSON bytes and exit code unchanged. Text mode and a valid --agent give the same output on both. Vitest-source: the regression fails on base and passes here; full build and packed launcher pass. Net 0 test lines. Receipts: openclaw/openclaw#199369 (comment).

Thanks @SunnyShu0925.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 15, 2026
…ures (openclaw#199369)

fix(cli): show the blank --agent error for sandbox explain --json

`openclaw sandbox explain --agent " " --json` threw its blank-agent check as a plain error, so the JSON failure printed only "The CLI command failed." and the doctor hint instead of the existing "--agent must not be blank". It now throws the same message through the existing expected-CLI-error path, as `models` and the channel selectors do. Text mode, exit codes and valid-agent output are unchanged. No new text.

Evidence: source tier with an isolated profile. With --json, base's stderr had only the generic failure and the doctor hint; this change prints the existing message, with JSON bytes and exit code unchanged. Text mode and a valid --agent give the same output on both. Vitest-source: the regression fails on base and passes here; full build and packed launcher pass. Net 0 test lines. Receipts: openclaw#199369 (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 docker Docker and sandbox tooling 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