-
-
Notifications
You must be signed in to change notification settings - Fork 79.1k
acp client subcommand error handler uses String(err) instead of formatErrorMessage #83904
Copy link
Copy link
Closed
Labels
P3Low-priority cleanup, docs, polish, ergonomics, or speculative work.Low-priority cleanup, docs, polish, ergonomics, or speculative work.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Metadata
Metadata
Assignees
Labels
P3Low-priority cleanup, docs, polish, ergonomics, or speculative work.Low-priority cleanup, docs, polish, ergonomics, or speculative work.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Severity: low / Confidence: high / Category: bug
Triage: confirmed-bug
Detected against: openclaw v2026.5.18 (latest stable at time of scan, 2026-05-18)
Tooling: clawpatch 0.3.0 + acpx/claude-sonnet-4-5 via Brad Mills protocol
Evidence
src/cli/acp-cli.ts:52-52(registerAcpCli)src/cli/acp-cli.ts:76-76(registerAcpCli)Reasoning
The parent acp command formats errors through formatErrorMessage, which normalises Error objects to readable messages. The acp client subcommand uses String(err), which for a plain Error produces '[object Error]' in environments where Error.prototype.toString returns the default. This degrades the UX for client failures versus server failures and creates inconsistency that makes log triage harder.
Reproduction
Throw a non-Error object (e.g. throw { code: 42 }) inside runAcpClientInteractive; the acp client action emits '[object Object]' while acp would emit a structured message.
Recommendation
Change line 76 in src/cli/acp-cli.ts from
defaultRuntime.error(String(err))todefaultRuntime.error(formatErrorMessage(err)). formatErrorMessage is already imported in the file.Why existing tests miss this
No tests exist for the CLI registration functions in this file group.
Suggested regression test
Unit test: mock runAcpClientInteractive to reject with a plain object; assert the emitted error message equals the output of formatErrorMessage, not '[object Object]'.
Minimum fix scope
Single-line change in src/cli/acp-cli.ts line 76.
Standardized clawpatch finding. Persistent in v2026.5.18 (not resolved by upgrading from v2026.5.12). Finding ID:
fnd_sig-feat-cli-command-17e3589ff2-_d9920221f1.