Skip to content

fix(skills): retain blank-agent remedies in JSON failures - #199910

Closed
Leon-SK668 wants to merge 1 commit into
openclaw:mainfrom
Leon-SK668:leon/fix-skills-blank-agent-remedy-20261116
Closed

Leon-SK668 wants to merge 1 commit into
openclaw:mainfrom
Leon-SK668:leon/fix-skills-blank-agent-remedy-20261116

Conversation

@Leon-SK668

Copy link
Copy Markdown
Contributor

What Problem This Solves

openclaw skills list --agent ' ' --json exits1 with the correct JSON failure, but stderr only says that the CLI failed and suggests openclaw doctor. The same happens for skills check and skills info. Operators capturing stdout miss the actual remedy: --agent must not be blank.

Why This Change Was Made

Classify the existing refusal at normalizeExplicitAgentId, the shared Skills admission owner. The existing command wrapper propagates classified errors, and the root renderer already owns their JSON envelope, stderr and exit status. No new formatter or broad error passthrough is needed.

Existing-solutions preflight: reuse throwExpectedCliError and the root renderer, following accepted diagnostic repairs #199616, #199639 and #199670. The separate system-agent selection proposal #195423 leaves this guard untouched; this PR does not change which configured agent is selected.

User Impact

List/check/info JSON failures now include the actionable message on stderr while keeping the same parsed JSON and exit1. Human refusals remain readable. Agent normalization/selection, workspace ownership, Gateway routing, registry behavior, sanitization and defaults are unchanged.

Two files: production +2/-1, tests +8/-0. The only net production growth is an import. One regression uses the existing command fixture; the native proof exercises sibling read commands and the separate verification path. No new config/default, protocol/schema, dependency, persistence, permission or auth surface.

Evidence

  • Frozen built-CLI proof on Linux/Node24.22.1: actionable stderr for three JSON refusals 0/3 before →3/3 after. Independently parsed JSON/messages and exit1 match; three human refusals, verification JSON and successful help are controls. Config bytes remain unchanged after all eight commands.
  • Final contributor head and build: e20293d57c5c053801fba0d8b7331b8441cc1839. The captured driver verifies that the native build stamp matches this head.
  • OPENCLAW_VITEST_RUNTIME=node node scripts/run-vitest.mjs src/cli/skills-cli.commands.test.ts src/cli/skills-cli.verify.test.ts --maxWorkers=1 --reporter=dot: 44 passed, exit0;141.48s Vitest/153.15s wrapper. Existing selection, unknown-agent, Gateway, cancellation and redaction coverage remains.
  • Targeted repository tsgo, typed oxlint, oxfmt, test-line ratchet and git diff --check: pass. No baseline/ledger edits. node --import ./scripts/tsx.mjs scripts/build-all.mts sourcePerformance: pass,209.4s.
  • Author simplification/test audit retained one existing-fixture regression and the existing output owner. This was author-reviewed under the user's independent-review waiver; it is not an independent review.

Not tested: successful Gateway or ClawHub calls, skill installation, live model/channel, installed upgrade, Windows/macOS, full repository suite, full release packaging or upstream CI. Native proof covers isolated local refusals and help. AI assistance was used for implementation and validation.

Exact-head proof receipt
status: PASS
product_sha: e20293d57c5c053801fba0d8b7331b8441cc1839
base_sha: 9e85a1a71795dd067c424923c4e187ab332852dd
claims: C1=Skills read commands retain their blank-agent remedy on stderr in JSON mode; C2=structured failures, exit1, human diagnostics, verification output and config bytes remain intact
covered_by: C1=same frozen native list/check/info refusals before and after; C2=independent JSON parsing, exit/readback checks, three human controls, verification control, help and44 focused tests
entry: built openclaw skills list/check/info --agent whitespace --json
owner: shared normalizeExplicitAgentId admission guard -> existing runCommandWithRuntime -> canonical root failure renderer
boundary: subprocess,config-file
readback: real built-CLI stdout and stderr captured independently; parsed JSON/message and exit status checked; isolated config bytes read after each command
proof_command: node refill-skills-native-proof-20261116.mjs CHECKOUT red|green; identical eight native inputs on both revisions
harness: frozen driver SHA256 8feb95783aa643cfa32af2a95bde42999b27d2ea61bb4a810aa65f4e801cebce; full driver and sanitized captured records published in PR body; build commit equals product_sha
before: RED 9e85a1a71795dd067c424923c4e187ab332852dd at 2026-11-16T02:17:29.453Z; actionable JSON stderr0/3, correct failure envelopes and exit1 retained3/3
after: GREEN e20293d57c5c053801fba0d8b7331b8441cc1839 at 2026-11-16T02:50:24.210Z; actionable JSON stderr3/3, correct failure envelopes and exit1 retained3/3
negative_claim: yes
control: three human refusals remain readable with empty stdout; verification JSON remains valid1/1; help succeeds1/1; config bytes unchanged8/8
consumers: canonical/mixed-case agent selection, unknown-agent rejection, Gateway errors, cancellation and secret-redaction tests retained; verification native control unchanged; Workshop shared resolver inspected
tests: node scripts/run-vitest.mjs src/cli/skills-cli.commands.test.ts src/cli/skills-cli.verify.test.ts --maxWorkers=1 --reporter=dot with OPENCLAW_VITEST_RUNTIME=node:44passed exit0; targeted tsgo, typed oxlint, oxfmt, test-line ratchet and diff checks pass; exact-head sourcePerformance build pass
tests_changed: yes
test_cost: two explicit files44tests141.48s Vitest/153.15s wrapper; one primary regression reused existing fixture, net8 test lines; native build209.4s
visual: no
screenshots: N/A: terminal output contract, no GUI claim
published: pr-body
not_tested: successful Gateway/ClawHub calls, skill installation, live model/channel, installed upgrade, cross-OS, full repository suite, full release packaging and upstream CI
reuse: baseline and contributor parent both9e85; latest fetched maina97d3d4f keeps the changed owner and root contribution/failure contracts unchanged; no code from other contributors executed
Captured native before/after readback
{
  "before": {
    "status": "PASS",
    "phase": "red",
    "head": "9e85a1a71795dd067c424923c4e187ab332852dd",
    "buildCommit": "9e85a1a71795dd067c424923c4e187ab332852dd",
    "node": "v24.22.1",
    "capturedAt": "2026-11-16T02:17:29.453Z",
    "driverSha256": "8feb95783aa643cfa32af2a95bde42999b27d2ea61bb4a810aa65f4e801cebce",
    "observations": [
      {
        "args": [
          "skills",
          "list",
          "--agent",
          " \t ",
          "--json"
        ],
        "exit": 1,
        "stdout": "{\n  \"ok\": false,\n  \"error\": {\n    \"type\": \"cli_error\",\n    \"message\": \"--agent must not be blank\"\n  }\n}\n",
        "stderr": "[openclaw] The CLI command failed.\n[openclaw] For help, run `openclaw doctor`.\n"
      },
      {
        "args": [
          "skills",
          "list",
          "--agent",
          " \t "
        ],
        "exit": 1,
        "stdout": "",
        "stderr": "--agent must not be blank\n"
      },
      {
        "args": [
          "skills",
          "check",
          "--agent",
          " \t ",
          "--json"
        ],
        "exit": 1,
        "stdout": "{\n  \"ok\": false,\n  \"error\": {\n    \"type\": \"cli_error\",\n    \"message\": \"--agent must not be blank\"\n  }\n}\n",
        "stderr": "[openclaw] The CLI command failed.\n[openclaw] For help, run `openclaw doctor`.\n"
      },
      {
        "args": [
          "skills",
          "check",
          "--agent",
          " \t "
        ],
        "exit": 1,
        "stdout": "",
        "stderr": "--agent must not be blank\n"
      },
      {
        "args": [
          "skills",
          "info",
          "synthetic-skill",
          "--agent",
          " \t ",
          "--json"
        ],
        "exit": 1,
        "stdout": "{\n  \"ok\": false,\n  \"error\": {\n    \"type\": \"cli_error\",\n    \"message\": \"--agent must not be blank\"\n  }\n}\n",
        "stderr": "[openclaw] The CLI command failed.\n[openclaw] For help, run `openclaw doctor`.\n"
      },
      {
        "args": [
          "skills",
          "info",
          "synthetic-skill",
          "--agent",
          " \t "
        ],
        "exit": 1,
        "stdout": "",
        "stderr": "--agent must not be blank\n"
      },
      {
        "args": [
          "skills",
          "verify",
          "synthetic-skill",
          "--agent",
          " ",
          "--json"
        ],
        "exit": 1,
        "stdout": "{\n  \"ok\": false,\n  \"error\": {\n    \"type\": \"cli_error\",\n    \"message\": \"--agent must not be blank\"\n  }\n}\n",
        "stderr": ""
      },
      {
        "args": [
          "skills",
          "--help"
        ],
        "exit": 0,
        "stdout": "\nOpenClaw 2026.11.3 (9e85a1a) — All your chats, one OpenClaw.\n\nUsage: openclaw skills [options] [command]\n\nList and inspect available skills\n\nOptions:\n  --agent <id>  Target agent workspace (defaults to cwd-inferred, then default\n                agent)\n  -h, --help    Display help for command\n  --json        Output as JSON (default: false)\n\nCommands:\n  check         Check which skills are ready, visible, or missing requirements\n  info          Show detailed information about a skill\n  install       Install a skill from ClawHub, git, or a local directory\n  library       Manage authenticated personal and team skill libraries\n  list          List all available skills\n  search        Search ClawHub skills\n  update        Update ClawHub-installed skills in the active or shared managed\n                directory\n  verify        Verify a ClawHub skill with ClawHub\n\nDocs: https://docs.openclaw.ai/cli/skills\n\n",
        "stderr": ""
      }
    ],
    "configUnchangedByCommands": true,
    "limitations": "Isolated Linux built-CLI argument refusal and help. No skill installation, registry request, Gateway service, live model, upgrade or cross-OS result is claimed."
  },
  "after": {
    "status": "PASS",
    "phase": "green",
    "head": "e20293d57c5c053801fba0d8b7331b8441cc1839",
    "buildCommit": "e20293d57c5c053801fba0d8b7331b8441cc1839",
    "node": "v24.22.1",
    "capturedAt": "2026-11-16T02:50:24.210Z",
    "driverSha256": "8feb95783aa643cfa32af2a95bde42999b27d2ea61bb4a810aa65f4e801cebce",
    "observations": [
      {
        "args": [
          "skills",
          "list",
          "--agent",
          " \t ",
          "--json"
        ],
        "exit": 1,
        "stdout": "{\n  \"ok\": false,\n  \"error\": {\n    \"type\": \"cli_error\",\n    \"message\": \"--agent must not be blank\"\n  }\n}\n",
        "stderr": "--agent must not be blank\n"
      },
      {
        "args": [
          "skills",
          "list",
          "--agent",
          " \t "
        ],
        "exit": 1,
        "stdout": "",
        "stderr": "--agent must not be blank\n"
      },
      {
        "args": [
          "skills",
          "check",
          "--agent",
          " \t ",
          "--json"
        ],
        "exit": 1,
        "stdout": "{\n  \"ok\": false,\n  \"error\": {\n    \"type\": \"cli_error\",\n    \"message\": \"--agent must not be blank\"\n  }\n}\n",
        "stderr": "--agent must not be blank\n"
      },
      {
        "args": [
          "skills",
          "check",
          "--agent",
          " \t "
        ],
        "exit": 1,
        "stdout": "",
        "stderr": "--agent must not be blank\n"
      },
      {
        "args": [
          "skills",
          "info",
          "synthetic-skill",
          "--agent",
          " \t ",
          "--json"
        ],
        "exit": 1,
        "stdout": "{\n  \"ok\": false,\n  \"error\": {\n    \"type\": \"cli_error\",\n    \"message\": \"--agent must not be blank\"\n  }\n}\n",
        "stderr": "--agent must not be blank\n"
      },
      {
        "args": [
          "skills",
          "info",
          "synthetic-skill",
          "--agent",
          " \t "
        ],
        "exit": 1,
        "stdout": "",
        "stderr": "--agent must not be blank\n"
      },
      {
        "args": [
          "skills",
          "verify",
          "synthetic-skill",
          "--agent",
          " ",
          "--json"
        ],
        "exit": 1,
        "stdout": "{\n  \"ok\": false,\n  \"error\": {\n    \"type\": \"cli_error\",\n    \"message\": \"--agent must not be blank\"\n  }\n}\n",
        "stderr": ""
      },
      {
        "args": [
          "skills",
          "--help"
        ],
        "exit": 0,
        "stdout": "\nOpenClaw 2026.11.3 (e20293d) — All your chats, one OpenClaw.\n\nUsage: openclaw skills [options] [command]\n\nList and inspect available skills\n\nOptions:\n  --agent <id>  Target agent workspace (defaults to cwd-inferred, then default\n                agent)\n  -h, --help    Display help for command\n  --json        Output as JSON (default: false)\n\nCommands:\n  check         Check which skills are ready, visible, or missing requirements\n  info          Show detailed information about a skill\n  install       Install a skill from ClawHub, git, or a local directory\n  library       Manage authenticated personal and team skill libraries\n  list          List all available skills\n  search        Search ClawHub skills\n  update        Update ClawHub-installed skills in the active or shared managed\n                directory\n  verify        Verify a ClawHub skill with ClawHub\n\nDocs: https://docs.openclaw.ai/cli/skills\n\n",
        "stderr": ""
      }
    ],
    "configUnchangedByCommands": true,
    "limitations": "Isolated Linux built-CLI argument refusal and help. No skill installation, registry request, Gateway service, live model, upgrade or cross-OS result is claimed."
  }
}
Frozen native driver (synthetic isolated inputs)
import assert from "node:assert/strict";
import fs from "node:fs";
import os from "node:os";
import path from "node:path";
import { createHash } from "node:crypto";
import { execFileSync, spawnSync } from "node:child_process";
import { fileURLToPath } from "node:url";

const [repoArg, phase] = process.argv.slice(2);
assert.ok(["red", "green"].includes(phase));
const repo = path.resolve(repoArg);
const head = execFileSync("git", ["rev-parse", "HEAD"], { cwd: repo, encoding: "utf8" }).trim();
const build = JSON.parse(fs.readFileSync(path.join(repo, "dist/build-info.json"), "utf8"));
assert.equal(build.commit, head);
const root = fs.mkdtempSync(path.join(os.tmpdir(), "leon-skills-remedy-"));
fs.chmodSync(root, 0o700);
const configPath = path.join(root, "openclaw.json");
const config = JSON.stringify({ meta: { migrations: { skillWorkshopPlugin: true } },
  gateway: { mode: "local" }, plugins: { allow: [], slots: { memory: "none" } },
  agents: { ownership: "explicit", entries: { main: { workspace: path.join(root, "workspace") } },
    defaults: { systemAgent: { agentId: "main" } } },
  logging: { consoleLevel: "error", file: path.join(root, "runtime.log") } });
fs.writeFileSync(configPath, config, { mode: 0o600 });
const env = { PATH: process.env.PATH, LANG: "C.UTF-8", NO_COLOR: "1", OPENCLAW_HOME: root,
  OPENCLAW_STATE_DIR: path.join(root, "state"), OPENCLAW_CONFIG_PATH: configPath,
  OPENCLAW_NO_RESPAWN: "1", OPENCLAW_SKIP_STARTUP_MODEL_PREWARM: "1",
  XDG_CONFIG_HOME: path.join(root, "xdg-config"), XDG_CACHE_HOME: path.join(root, "xdg-cache") };
const observations = [];
function cli(args) {
  const result = spawnSync(process.execPath, [path.join(repo, "openclaw.mjs"), ...args],
    { cwd: repo, env, encoding: "utf8", timeout: 90_000 });
  assert.equal(result.error, undefined); assert.equal(result.signal, null);
  const clean = value => value.replaceAll(root, "<isolated-state>").replaceAll(repo, "<checkout>");
  const record = { args, exit: result.status, stdout: clean(result.stdout), stderr: clean(result.stderr) };
  observations.push(record);
  assert.equal(fs.readFileSync(configPath, "utf8"), config);
  return record;
}
const reason = "--agent must not be blank";
for (const leaf of [["list"], ["check"], ["info", "synthetic-skill"]]) {
  const result = cli(["skills", ...leaf, "--agent", " \t ", "--json"]);
  assert.equal(result.exit, 1);
  assert.deepEqual(JSON.parse(result.stdout), { ok: false, error: { type: "cli_error", message: reason } });
  assert.equal(result.stderr.includes(reason), phase === "green", JSON.stringify(result));
  if (phase === "green") {
    assert.ok(!result.stderr.includes("Run openclaw doctor"));
    assert.ok(!result.stderr.includes("failed to start CLI"));
    assert.ok(!/\bat .*:\d+:\d+/.test(result.stderr));
  }
  const human = cli(["skills", ...leaf, "--agent", " \t "]);
  assert.equal(human.exit, 1); assert.equal(human.stdout, "");
  assert.ok(human.stderr.includes(reason), JSON.stringify(human));
}
const verify = cli(["skills", "verify", "synthetic-skill", "--agent", " ", "--json"]);
assert.equal(verify.exit, 1);
assert.deepEqual(JSON.parse(verify.stdout), { ok: false, error: { type: "cli_error", message: reason } });
const help = cli(["skills", "--help"]);
assert.equal(help.exit, 0); assert.ok(help.stdout.includes("--agent <id>"));
console.log(JSON.stringify({ status: "PASS", phase, head, buildCommit: build.commit, node: process.version,
  capturedAt: new Date().toISOString(), driverSha256: createHash("sha256").update(fs.readFileSync(fileURLToPath(import.meta.url))).digest("hex"),
  observations, configUnchangedByCommands: true,
  limitations: "Isolated Linux built-CLI argument refusal and help. No skill installation, registry request, Gateway service, live model, upgrade or cross-OS result is claimed." }, null, 2));

@clawsweeper

clawsweeper Bot commented Nov 16, 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 cli CLI command changes size: XS labels Nov 16, 2026
@obviyus

obviyus commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the work here. We're closing this one along with the other open per-command --json error fixes. These PRs all fix the same root cause one command at a time: runCommandWithRuntime rethrows plain errors in JSON mode, so the root renderer prints the generic failure instead of the existing message. We're fixing that once in the shared wrapper instead, which covers this command too. Please don't open more per-command variants of this fix; if you find a case the shared fix doesn't cover, open an issue with a reproduction.

@obviyus obviyus closed this Nov 16, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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. labels Nov 16, 2026
@clawsweeper

clawsweeper Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge.

What this changes

This PR preserves the blank-agent error message on stderr when skills commands fail in JSON mode.

Example: Run openclaw skills list --agent ' ' --json.

  • Before: Exit 1 and correct JSON stdout, but stderr gives a generic failure and suggests Doctor.
  • After: Exit 1 and the same JSON stdout, with --agent must not be blank on stderr.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A focused repair using the existing owner, supported by directly relevant native before-and-after output and one targeted regression.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): Inspected built-CLI Linux/Node captures exercise the shared normalization guard through list/check/info at the exact head: stderr gains the remedy, parsed JSON and exit 1 remain intact, and human, verification, help, and config-byte controls are preserved.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Operators reserving stdout for JSON receive generic stderr guidance instead of the existing blank-agent remedy.
Reason: The change restores actionable diagnostics through established CLI ownership while preserving validation, selection, JSON output, and exit status.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep open: this PR fixes a current diagnostic defect with a minimal change, and no introduced correctness or security defect was found; GitHub Actions approval remains pending.

Priority: P2
Reviewed head: e20293d57c5c053801fba0d8b7331b8441cc1839

Before merge

  • Await maintainer action - Approve the GitHub Actions runs awaiting approval for the reviewed head.

Findings

None.

Agent review details

How this fits together

Skills commands pass agent options through the shared workspace resolver; classified validation failures propagate through the command wrapper to the root JSON and human-output renderer.

flowchart TD
  A[Skills CLI arguments] --> B[Shared agent normalization]
  B --> C[Expected CLI error]
  C --> D[Command runtime wrapper]
  D --> E[Root failure renderer]
  E --> F[JSON stdout]
  E --> G[Actionable stderr and exit 1]
Loading

Technical review

Best possible solution:

Keep validation in the shared normalization owner and use the existing expected-error renderer, as this PR does.

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

Current-main source establishes the failure path, and supplied native base captures show the generic stderr response; this read-only review executed no target code.

Is this the best way to solve the issue?

The patch is the smallest complete fix: the refusal must remain actionable through the root renderer, and classifying it at its existing producer satisfies that invariant without adding another output path.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Blank-agent validation and error classification keeps the original intent (08f4a19: This commit moved an existing guard into the shared CLI host during the Workshop plugin extraction, preserving behavior; it is relocation provenance, not the guard's verified introduction.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Pinned introduced change: The introduced patch replaces the existing blank-agent Error with throwExpectedCliError and adds one regression using the existing command fixture. (src/cli/skills-cli-gateway.ts:49, e20293d57c5c)
  • Current main still needs the fix: Current main retains the ordinary blank-agent Error; the shared owner, command wrapper, and failure renderer have no changes relative to the PR base. (src/cli/skills-cli-gateway.ts:48, 2159567b9ffc)
  • Existing rendering contract: The command wrapper propagates expected errors, and the root renderer prints their human output while preserving the canonical JSON envelope. (src/cli/failure-output.ts:264, e20293d57c5c)
  • Full native proof inspected: The complete REST body supplies the frozen driver and independently captured stdout, stderr, and exit codes for built-CLI list/check/info refusals on the base and exact head, plus human-mode, verification, help, and unchanged-config controls. Captured body identity: SHA256 60bc822af683faba161037b7527bee3938711d889618b97169fefc0f290ccabd. (e20293d57c5c)
  • Historical ownership and preserved intent: The Workshop extraction carried the existing normalization guard from skills-cli.ts into skills-cli-gateway.ts; it did not introduce that guard. Main blame attributes the moved lines to that extraction. Deeper content-history searches encountered unavailable promisor blobs, so the original introduction remains unverified. (src/cli/skills-cli-gateway.ts:45, 08f4a198a310)
  • Accepted diagnostic precedent: The merged directory repair uses the same expected-error classification for actionable stderr alongside JSON, with maintainer validation recorded at fix(cli): show directory failure remedies alongside JSON #199616. (285a3261d7dd)

PR surface

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

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

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 P2: A bounded CLI diagnostic bug obscures the remedy on stderr while retaining correct JSON output and a nonzero exit.
  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • add status: ⏳ waiting on maintainer: Only explicit maintainer approvals or decisions remain; merge is still blocked.

Label justifications:

  • P2: A bounded CLI diagnostic bug obscures the remedy on stderr while retaining correct JSON output and a nonzero exit.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: ⏳ waiting on maintainer: Only explicit maintainer approvals or decisions remain; merge is still blocked.
  • 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.

Reviewed November 15, 2026, 10:20 PM ET / November 16, 2026, 03:20 UTC.

obviyus added a commit that referenced this pull request Nov 16, 2026
fix(cli): show the existing failure message for plain errors in --json mode

`runCommandWithRuntime` rethrew every plain error in JSON mode, so the root renderer printed only the generic "The CLI command failed." plus the Doctor hint on stderr, while text mode printed the error's own (redacted) message. Contributors had been patching this one command at a time by converting individual throws to expected errors. JSON mode now shows the same redacted message text mode already shows, once in the shared wrapper; the JSON stdout envelope, exit codes and text-mode output are unchanged. Commands that fail outside the wrapper (for example `models auth login` conflicts and `attach` target resolution) are not covered. No new text.

Evidence: host, isolated state. 76 CLI runs across eight command flows (including `backup verify`, `backup remote`, `skills list/check/info` and `migrate plan/apply`), twice per side: base prints the generic failure in --json mode, this change prints the existing message; text failure output, JSON stdout and exit codes are identical across 150 comparisons. 156 unit and 124 consumer tests pass; full build and installed packed smoke pass. CI reds are inherited from main (receipt: #199970 (comment)).

Supersedes the closed per-command PRs #199891, #199900, #199910 and #199448.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 17, 2026
fix(cli): show the existing failure message for plain errors in --json mode

`runCommandWithRuntime` rethrew every plain error in JSON mode, so the root renderer printed only the generic "The CLI command failed." plus the Doctor hint on stderr, while text mode printed the error's own (redacted) message. Contributors had been patching this one command at a time by converting individual throws to expected errors. JSON mode now shows the same redacted message text mode already shows, once in the shared wrapper; the JSON stdout envelope, exit codes and text-mode output are unchanged. Commands that fail outside the wrapper (for example `models auth login` conflicts and `attach` target resolution) are not covered. No new text.

Evidence: host, isolated state. 76 CLI runs across eight command flows (including `backup verify`, `backup remote`, `skills list/check/info` and `migrate plan/apply`), twice per side: base prints the generic failure in --json mode, this change prints the existing message; text failure output, JSON stdout and exit codes are identical across 150 comparisons. 156 unit and 124 consumer tests pass; full build and installed packed smoke pass. CI reds are inherited from main (receipt: openclaw#199970 (comment)).

Supersedes the closed per-command PRs openclaw#199891, openclaw#199900, openclaw#199910 and openclaw#199448.

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

cli CLI command changes P2 Normal backlog priority with limited blast radius. 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: ⏳ waiting on maintainer Only explicit maintainer approvals or decisions remain; merge is still blocked.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants