Bug
In packages/code/src/acp/agent.ts:646, when requestPermission fails, the error message shows [object Object] instead of the actual error details.
Current code:
message: `Error requesting permission: ${error instanceof Error ? error.message : String(error)}`,
The ACP SDK throws JSON-RPC error objects (e.g. { code: -32601, message: "Method not handled" }) which are not Error instances. String({code: -32601, message: "..."}) produces [object Object].
Fix
Use JSON.stringify for non-Error objects:
message: `Error requesting permission: ${error instanceof Error ? error.message : JSON.stringify(error)}`,
Reproduction
When the ACP client does not handle session/request_permission, the agent receives an error response but displays:
Error: Edit operation denied by user, reason: Error requesting permission: [object Object]
Instead of:
Error: Edit operation denied by user, reason: Error requesting permission: {"code":-32601,"message":"Method not handled: session/request_permission"}
Bug
In packages/code/src/acp/agent.ts:646, when requestPermission fails, the error message shows [object Object] instead of the actual error details.
Current code:
The ACP SDK throws JSON-RPC error objects (e.g.
{ code: -32601, message: "Method not handled" }) which are not Error instances.String({code: -32601, message: "..."})produces[object Object].Fix
Use JSON.stringify for non-Error objects:
Reproduction
When the ACP client does not handle session/request_permission, the agent receives an error response but displays:
Instead of: