Skip to content

Commit 5d19beb

Browse files
hclclawsweeper[bot]Takhoffman
authored
fix(cli): format acp client errors with formatErrorMessage (#83904) (#84080)
Summary: - The PR changes `openclaw acp client` error handling to use `formatErrorMessage`, adds a plain-object rejection regression test, and adds a changelog entry. - Reproducibility: yes. Current main visibly sends `openclaw acp client` caught errors through `String(err)`, ... catch already uses `formatErrorMessage`; I did not run a live failing ACP server in this read-only review. Automerge notes: - PR branch already contained follow-up commit before automerge: fix(cli): format acp client errors with formatErrorMessage (#83904) Validation: - ClawSweeper review passed for head 69ef0e7. - Required merge gates passed before the squash merge. Prepared head SHA: 69ef0e7 Review: #84080 (comment) Co-authored-by: HCL <chenglunhu@gmail.com> Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com> Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com> Approved-by: takhoffman Co-authored-by: takhoffman <781889+takhoffman@users.noreply.github.com>
1 parent 13c97c5 commit 5d19beb

3 files changed

Lines changed: 14 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Docs: https://docs.openclaw.ai
1515
- Control UI: treat terminal session status as authoritative over stale active-run flags so completed terminal runs stop showing abort/live UI. (#84057)
1616
- CLI: preserve embedded equals signs in inline root option values instead of truncating after the second separator. (#83995) Thanks @ThiagoCAltoe.
1717
- Matrix/config: accept `messages.queue.byChannel.matrix` queue overrides and keep queue provider schema/type keys aligned for Matrix, Google Chat, and Mattermost. Thanks @bdjben.
18+
- CLI: format `openclaw acp client` failures through the shared error formatter so object-shaped errors stay readable instead of printing `[object Object]`. Fixes #83904. (#84080)
1819
- Providers/Ollama: default unknown-capabilities models to tool-capable so discovered native Ollama models can use tools when `/api/show` omits capabilities. (#84055) Thanks @dutifulbob.
1920
- Installer/Windows: launch `install.ps1` onboarding as an attached child process so fresh native Windows installs do not freeze visibly at `Starting setup...` or corrupt the wizard's terminal rendering.
2021
- Memory/search: close local embedding providers when active-memory searches time out so pending local model loads and embedding contexts are aborted and released. (#83858) Thanks @brokemac79.

src/cli/acp-cli.option-collisions.test.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,4 +165,16 @@ describe("acp cli option collisions", () => {
165165
await parseAcp(["--token-file", "/tmp/openclaw-acp-missing-token.txt"]);
166166
expectCliError(/Failed to (inspect|read) Gateway token file/);
167167
});
168+
169+
it("formats client errors with formatErrorMessage instead of String(err) (#83904)", async () => {
170+
runAcpClientInteractive.mockImplementationOnce(async () => {
171+
throw { code: 42, why: "boom" } as unknown as Error;
172+
});
173+
const program = createAcpProgram();
174+
await program.parseAsync(["acp", "client"], { from: "user" });
175+
176+
const errors = defaultRuntime.error.mock.calls.map(([message]) => String(message));
177+
expect(errors).toContain('{"code":42,"why":"boom"}');
178+
expect(defaultRuntime.exit).toHaveBeenCalledWith(1);
179+
});
168180
});

src/cli/acp-cli.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export function registerAcpCli(program: Command) {
7373
verbose: Boolean(opts.verbose || inheritedVerbose),
7474
});
7575
} catch (err) {
76-
defaultRuntime.error(String(err));
76+
defaultRuntime.error(formatErrorMessage(err));
7777
defaultRuntime.exit(1);
7878
}
7979
});

0 commit comments

Comments
 (0)