Skip to content

fix(proxy): proxy run prints only "The CLI command failed." when the command cannot be started - #197254

Closed
yxshee wants to merge 1 commit into
openclaw:mainfrom
yxshee:fix/proxy-run-command-not-found
Closed

yxshee wants to merge 1 commit into
openclaw:mainfrom
yxshee:fix/proxy-run-command-not-found

Conversation

@yxshee

@yxshee yxshee commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes: openclaw proxy run -- COMMAND prints only The CLI command failed. when the command cannot be started, for example a mistyped command name or a file that is not executable. The proxy starts and stops cleanly, but the user is not told that the child command never ran or why.

User Impact

User impact: the CLI now says which command could not be started and why (command not found or permission denied) and still exits with status 1. A child that starts and then fails keeps its own exit code and output, and a successful run is unchanged.

Why This Change Was Made

runDebugProxyRunCommand already detects a child that failed during launch (no exit code and no signal) and throws the raw spawn error. The root renderer hides the reason of an unclassified error unless --debug is passed, so only the generic line was shown. Launch failures with ENOENT or EACCES are now raised as ExpectedCliError with a specific message, the same way #191295 handled proxy run without a command and proxy blob with an unknown id. The original spawn error is kept as the cause, other launch failures still throw as before, and the proxy server and capture session are still closed (the new test asserts the server stop).

Evidence

From source on main at f5d0c19, Linux, Node 24.22.2, fresh state directory.

Before:

$ openclaw proxy run zz-nope --version
[openclaw] The CLI command failed.
[openclaw] For help, run `openclaw doctor`.
exit=1
$ openclaw proxy run /etc/hostname
[openclaw] The CLI command failed.
[openclaw] For help, run `openclaw doctor`.
exit=1

After:

$ openclaw proxy run zz-nope --version
proxy run could not start "zz-nope": command not found.
exit=1
$ openclaw proxy run /etc/hostname
proxy run could not start "/etc/hostname": permission denied.
exit=1

Unchanged controls with the fix:

$ openclaw proxy run -- sh -c "exit 3"
exit=3
$ openclaw proxy run -- echo ok
ok
exit=0

Tests:

  • pnpm test src/cli/proxy-cli.runtime.test.ts --maxWorkers=1: 27 passed.
  • New cases "names the launch failure when the proxied command fails with ENOENT" and "... with EACCES" fail on main (the raw Command failed with ENOENT error is thrown) and pass with the fix.
  • Test-line budget: 20 added lines, allocated in config/test-lines-allocations/proxy-run-launch-failure.txt; pnpm check:test-lines-ratchet --staged passes.
  • pnpm tsgo:core, oxfmt --check and oxlint --type-aware on the changed files: clean. docs/cli/proxy.md mentions the new reason next to the existing note from fix(cli): preserve existing proxy and transcript error reasons #191295.

@clawsweeper

clawsweeper Bot commented Nov 11, 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 docs Improvements or additions to documentation cli CLI command changes size: XS labels Nov 11, 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. P2 Normal backlog priority with limited blast radius. 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. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Nov 11, 2026
@clawsweeper

clawsweeper Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR identifies missing or non-executable child commands in proxy run errors while preserving exit handling and cleanup.

Example: Run openclaw proxy run zz-nope --version.

  • Before: The CLI prints The CLI command failed. and exits 1.
  • After: The CLI prints proxy run could not start "zz-nope": command not found. and exits 1.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, useful repair supported by real CLI traces and targeted red/green regression results, with no open correctness or security finding.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): The PR body exercises the real openclaw proxy run entry point on Linux with Node 24.22.2 and fresh state: ENOENT and EACCES print the new command-specific reasons and exit 1, while an executed child retains exit 3 and echo retains output and exit 0.
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 mistyped or non-executable proxied command produces a generic CLI failure without explaining why the child never started.
Reason: Specific launch diagnostics provide clear user value through an established error owner without adding configuration, persistent state, or execution policy.

Merge readiness

✅ Ready for maintainer review

Keep open: this PR fixes a current CLI diagnostic defect with a focused change, relevant regression coverage, and supplied before/after CLI evidence; no actionable introduced bug was found.

Priority: P2
Reviewed head: bb5bee7999397fabf2a677b51a3779897dd39403

Before merge

None.

Findings

None.

Agent review details

How this fits together

The proxy CLI starts a local capture proxy, launches the requested child through the shared process owner, finalizes capture resources, and passes failures to the root CLI renderer.

flowchart TD
  A[Proxy CLI arguments] --> B[Proxy runtime]
  B --> C[Capture owner and local proxy]
  B --> D[Shared process launcher]
  D --> E[Launch result classification]
  E --> F[Capture cleanup]
  F --> G[Root CLI error renderer]
Loading

Technical review

Best possible solution:

Merge the focused launch-error classification through the existing ExpectedCliError owner while retaining child exit semantics and capture cleanup.

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

Current-main source traces launch failures to an unclassified error and generic root output; the contributor supplies matching CLI reproductions, but this read-only review ran no target code.

Is this the best way to solve the issue?

The patch fixes diagnostic classification at the proxy command owner, reuses existing errno and rendering contracts, and leaves successful execution, other failures, and cleanup unchanged.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Proxy launch failures and cleanup keeps the original intent (98813c2: The shutdown repair moved child execution to the shared process owner and retained child settlement and capture cleanup before exit.)
  • Expected proxy CLI diagnostics and documentation keeps the original intent (fced905: The earlier repair exposed actionable proxy input errors through ExpectedCliError while preserving exit status and successful behavior.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Introduced change: The pinned introduction diff limits production changes to classifying ENOENT and EACCES through ExpectedCliError, retaining the original cause and existing cleanup. (src/cli/proxy-cli.runtime.ts:168, bb5bee799939)
  • Current-main defect: Current main still throws the raw launch failure when the child has neither an exit code nor a signal; the root renderer only exposes the specific output for expected CLI errors. (src/cli/proxy-cli.runtime.ts:168, 8ae6b3852f97)
  • Existing rendering owner: ExpectedCliError already owns human and machine diagnostics, and the root renderer prints its human output directly. (src/cli/failure-output.ts:264, bb5bee799939)
  • Supplied real CLI evidence: The full PR body supplies Linux, Node 24.22.2, isolated-state before/after command output for missing and non-executable commands, plus unchanged exit-3 and successful echo controls; it also reports both new cases failing before the fix. (bb5bee799939)
  • Prior diagnostic repair: The merged fix(cli): preserve existing proxy and transcript error reasons #191295 established this error-classification pattern for missing command arguments and unknown blobs, but did not fix child launch failures. (src/cli/proxy-cli.runtime.ts:98, fced9054e725)
  • Feature history and inspection limit: Feature history includes the original proxy capture implementation, subsequent capture-ownership and shutdown work, and the merged diagnostic repair. An unavailable old blob limited follow-history searches; readable commits, current-line blame, and supplied provenance establish the relevant contracts. (src/cli/proxy-cli.runtime.ts, 8ae6b3852f97)

Likely related people:

  • Peter Steinberger: Raw commit 94907ee adds src/cli/proxy-cli.runtime.ts:128 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 94907ee9f91a; files: src/cli/proxy-cli.runtime.ts)
  • Ayaan Zaidi: Raw commit fced905 adds src/cli/proxy-cli.runtime.ts:97 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: fced9054e725; files: src/cli/proxy-cli.runtime.ts)
  • Tak Hoffman: Raw commit 958c34e adds src/cli/proxy-cli.runtime.ts:67 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 958c34e82cdb; files: src/cli/proxy-cli.runtime.ts)

PR surface

Source +20, Tests +20, Docs +1, Other +2. Total +43 across 4 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 22 2 +20
Tests 1 20 0 +20
Docs 1 3 2 +1
Config 0 0 0 0
Generated 0 0 0 0
Other 1 2 0 +2
Total 4 47 4 +43

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:

No label changes.

Label justifications:

  • P2: An advanced debugging command hides an actionable launch reason, with limited impact and unchanged execution behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit 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.

Reviewed November 11, 2026, 10:04 AM ET / 15:04 UTC.

@obviyus

obviyus commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the work here. We're closing this along with the author's other open PRs: the series splits one kind of change across many commands or call sites, and much of it is backed only by issues filed by the same author. Please open one issue per root cause with a reproduction from a real affected setup; maintainers will decide scope and fix it once at the shared owner.

@obviyus obviyus closed this Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clawtributors PR from a clawtributor cli CLI command changes docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary 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.

3 participants