Skip to content

Commit 69ef0e7

Browse files
clawsweeper[bot]hclsys
authored andcommitted
fix(cli): format acp client errors with formatErrorMessage (#83904)
1 parent 75fda56 commit 69ef0e7

3 files changed

Lines changed: 2 additions & 11 deletions

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: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -166,21 +166,15 @@ describe("acp cli option collisions", () => {
166166
expectCliError(/Failed to (inspect|read) Gateway token file/);
167167
});
168168

169-
// #83904: the `acp client` subcommand used `String(err)` while `acp` itself
170-
// already routed through `formatErrorMessage`. Non-Error throws (e.g. plain
171-
// objects) surfaced as `[object Object]` instead of a readable diagnostic.
172-
// After this fix both subcommands share the same formatter.
173169
it("formats client errors with formatErrorMessage instead of String(err) (#83904)", async () => {
174170
runAcpClientInteractive.mockImplementationOnce(async () => {
175-
// Plain-object throw: `String({})` → "[object Object]". `formatErrorMessage`
176-
// produces something more useful for log triage.
177171
throw { code: 42, why: "boom" } as unknown as Error;
178172
});
179173
const program = createAcpProgram();
180174
await program.parseAsync(["acp", "client"], { from: "user" });
181175

182176
const errors = defaultRuntime.error.mock.calls.map(([message]) => String(message));
183-
expect(errors.some((message) => message.includes("[object Object]"))).toBe(false);
177+
expect(errors).toContain('{"code":42,"why":"boom"}');
184178
expect(defaultRuntime.exit).toHaveBeenCalledWith(1);
185179
});
186180
});

src/cli/acp-cli.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,6 @@ export function registerAcpCli(program: Command) {
7373
verbose: Boolean(opts.verbose || inheritedVerbose),
7474
});
7575
} catch (err) {
76-
// Match the parent `acp` action a few lines up (line 52): both surfaces
77-
// route errors through `formatErrorMessage`, which normalises plain
78-
// Error objects and non-Error throws into a readable message instead of
79-
// the default `[object Object]` from `String(err)`. See #83904.
8076
defaultRuntime.error(formatErrorMessage(err));
8177
defaultRuntime.exit(1);
8278
}

0 commit comments

Comments
 (0)