fix(cli): format acp client errors with formatErrorMessage (#83904) (… · openclaw/openclaw@5d19beb
hclsys
·
2026-05-19
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -15,6 +15,7 @@ Docs: https://docs.openclaw.ai
|
15 | 15 | - Control UI: treat terminal session status as authoritative over stale active-run flags so completed terminal runs stop showing abort/live UI. (#84057) |
16 | 16 | - CLI: preserve embedded equals signs in inline root option values instead of truncating after the second separator. (#83995) Thanks @ThiagoCAltoe. |
17 | 17 | - 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) |
18 | 19 | - 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. |
19 | 20 | - 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. |
20 | 21 | - 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. |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -165,4 +165,16 @@ describe("acp cli option collisions", () => {
|
165 | 165 | await parseAcp(["--token-file", "/tmp/openclaw-acp-missing-token.txt"]); |
166 | 166 | expectCliError(/Failed to (inspect|read) Gateway token file/); |
167 | 167 | }); |
| 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 | +}); |
168 | 180 | }); |
| Original file line number | Diff line number | Diff line change |
|---|
@@ -73,7 +73,7 @@ export function registerAcpCli(program: Command) {
|
73 | 73 | verbose: Boolean(opts.verbose || inheritedVerbose), |
74 | 74 | }); |
75 | 75 | } catch (err) { |
76 | | -defaultRuntime.error(String(err)); |
| 76 | +defaultRuntime.error(formatErrorMessage(err)); |
77 | 77 | defaultRuntime.exit(1); |
78 | 78 | } |
79 | 79 | }); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。