paseo icon indicating copy to clipboard operation
paseo copied to clipboard

Desktop: ACP provider errors render as `[object Object]` — the actual message only reaches daemon.log

Open xiganos opened this issue 3 months ago • 4 comments

Summary

When an ACP provider returns a JSON-RPC error during agent creation, the desktop app renders the failure banner as literal [object Object]. The actual message never reaches the user — it only exists in ~/.paseo/daemon.log.

The error object is being string-concatenated instead of having its message read.

What the user sees

A new workspace, a New Agent tab, and a red banner containing exactly:

[object Object]

No error text, no code, no hint about which call failed or why. Creating the agent simply does not work and there is nothing actionable on screen.

What actually happened

From ~/.paseo/daemon.log at the same moment:

{"level":50,"msg":"Failed to create agent",
 "err":{"message":"Internal error: mode.plan.set requires an active host plan-mode lifecycle.",
        "name":"ACPRequestError"}}

So the daemon has a perfectly good message. Only the UI drops it.

For context, the underlying trigger in my case: I registered a custom ACP provider whose session/set_mode always fails. Paseo calls session/set_mode after session/new when the composer's selected mode differs from the session's currentModeId. With the mode dropdown on Plan it fails every time; switching it to Default (which matches currentModeId, so no set_mode call is made) works. That provider-side bug is filed separately upstream — this issue is only about the error being unreadable. Without reading the daemon log there was no way to discover any of the above.

Reproduction

Save this as acp-stub.mjs — a minimal ACP agent that answers initialize, session/new, and session/prompt normally but always rejects session/set_mode:

#!/usr/bin/env node
let buf = '';
const send = o => process.stdout.write(JSON.stringify(o) + '\n');
process.stdin.on('data', d => {
  buf += d;
  let i;
  while ((i = buf.indexOf('\n')) >= 0) {
    const line = buf.slice(0, i); buf = buf.slice(i + 1);
    if (!line.trim()) continue;
    let m; try { m = JSON.parse(line); } catch { continue; }
    if (m.method === 'initialize') {
      send({ jsonrpc:'2.0', id:m.id, result:{ protocolVersion:1,
        agentInfo:{ name:'acp-stub', title:'ACP Stub', version:'0.0.1' },
        agentCapabilities:{ promptCapabilities:{}, sessionCapabilities:{} } } });
    } else if (m.method === 'session/new') {
      send({ jsonrpc:'2.0', id:m.id, result:{ sessionId:'stub-session-1',
        modes:{ currentModeId:'default',
                availableModes:[{id:'default',name:'Default'},{id:'plan',name:'Plan'}] } } });
    } else if (m.method === 'session/set_mode') {
      send({ jsonrpc:'2.0', id:m.id, error:{ code:-32603,
        message:'Internal error: stub refuses set_mode',
        data:{ code:'stub_refuses', details:'reproduction stub' } } });
    } else if (m.method === 'session/prompt') {
      send({ jsonrpc:'2.0', id:m.id, result:{ stopReason:'end_turn' } });
    } else if (m.id != null) {
      send({ jsonrpc:'2.0', id:m.id, error:{ code:-32601, message:'not implemented' } });
    }
  }
});

Verified it behaves as described:

$ printf '%s\n' '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":1,"clientCapabilities":{}}}' \
  '{"jsonrpc":"2.0","id":2,"method":"session/new","params":{"cwd":"/tmp","mcpServers":[]}}' \
  '{"jsonrpc":"2.0","id":3,"method":"session/set_mode","params":{"sessionId":"stub-session-1","modeId":"plan"}}' \
  | node acp-stub.mjs
{"jsonrpc":"2.0","id":1,"result":{...}}
{"jsonrpc":"2.0","id":2,"result":{"sessionId":"stub-session-1","modes":{"currentModeId":"default",...}}}
{"jsonrpc":"2.0","id":3,"error":{"code":-32603,"message":"Internal error: stub refuses set_mode",...}}

Then:

  1. Register it in ~/.paseo/config.json:
    { "agents": { "providers": { "acp-stub": {
          "extends": "acp", "label": "ACP Stub",
          "command": ["node", "/absolute/path/to/acp-stub.mjs"] } } } }
    
  2. Restart the daemon.
  3. New workspace → new agent with ACP Stub, set the mode dropdown to Plan, send anything.
  4. Banner shows [object Object]; daemon.log shows stub refuses set_mode.

Expected

Surface the error message the daemon already has — e.g. Internal error: stub refuses set_mode, ideally with the JSON-RPC code and any data.code. A generic fallback (Unknown error) would still be better than [object Object], but ACP errors carry a usable message in practice.

Why this one matters more than a cosmetic glitch

[object Object] is not just ugly — it removes the only signal a user has. Registering third-party ACP agents is an explicitly supported feature, and third-party agents will return errors. Right now every one of those failures looks identical and unactionable, which pushes users toward "this provider is broken" rather than "this specific call failed for this specific reason."

Environment

  • Paseo desktop 0.2.5 (daemon 0.2.5), macOS 15.5 (Apple Silicon)
  • Custom ACP provider via ~/.paseo/config.json

xiganos avatar Aug 06 '26 00:08 xiganos

Two additional data points that extend this beyond the desktop UI:

  1. It also happens over the MCP create_agent tool, not just the desktop banner. A headless caller invoking mcp__paseo__create_agent gets a tool result of exactly [object Object] with no message/code/stack — same string-concatenation-instead-of-.message bug, but on the MCP tool-result path.

  2. In at least one create-time failure, the message does NOT reach daemon.log either — contradicting the "the actual message only reaches daemon.log" framing here. Concretely: create_agent for cursor/grok-4.6 with thinkingOptionId:"max" fails and returns [object Object], and a full capture of daemon.log across that exact moment shows no level:50 / Failed to create agent / cursor / ACP line at all (a codex create in the same second logs normally). So this class of error can be swallowed on both surfaces at once, leaving zero actionable signal anywhere.

The underlying trigger in that case is filed separately as #3466 (cursor rejecting its own advertised-default thinking option). But like your session/set_mode case, the point here is only that the error is unreadable — and in this instance not even recoverable from the daemon log.

kop avatar Aug 16 '26 19:08 kop

Same on Windows, daemon+desktop 0.6.1, with a concrete ACP error to add as evidence.

What happened: creating an agent from a kimi (custom ACP) profile with plan mode failed in the UI with [object Object]. The daemon log only shows:

msg: "Failed to create agent"
err: { "type": "Object", "message": "Internal error" }   // no stack, no details

Underlying ACP exchange (reproduced against kimi acp directly): the provider answers session/set_mode {"modeId": "plan"} with

{"code": -32603, "message": "Internal error", "data": {"details": "Already in plan mode"}}

So the genuinely useful reason lives in error.data.details, but two things eat it:

  1. Server side: toACPRequestError → summarizeACPRequestError keeps only error.message ("Internal error") and drops error.data.details, so even daemon.log doesn't record the real reason. Preserving data.details (when present) in the wrapped ACPRequestError message would have made this a 1-minute diagnosis instead of a protocol-level repro.
  2. App side: the plain-object error reaches the desktop UI and renders as [object Object] (this issue).

Versions: Paseo 0.6.1, Windows 10 22H2, kimi-code 0.39.x as the ACP provider. Upstream provider bug filed separately at MoonshotAI/kimi-code#3356 — but the error-surfacing problem here is provider-independent.

HiyodoGame avatar Aug 29 '26 05:08 HiyodoGame

Thanks for the detailed reproduction. I would like to work on this. I will trace the structured ACP error across the create-agent response paths, add focused regression coverage, and verify that the UI and MCP surfaces receive an actionable message instead of [object Object]. Please assign this issue to me if you use assignees.

githubbzxs avatar Aug 30 '26 13:08 githubbzxs

Fixed by #5765. When an ACP agent rejects the mode, model, thinking level, or a feature that Paseo sets while creating an agent, the error now carries the agent's message instead of [object Object]. That covers the desktop banner and the MCP create_agent result.

The message includes data.details when the agent sends it, so the cases in this thread now read:

Internal error: stub refuses set_mode: reproduction stub
Internal error: Already in plan mode

The fix is merged and will be in the next release, whose version number is not decided yet. v0.10.2 is the current release and does not contain it. Changes often appear in a beta on the releases page before the stable release.

Thanks @xiganos for the stub reproduction, and @kop and @HiyodoGame for the MCP and Kimi cases.

paseo-bot[bot] avatar Sep 30 '26 16:09 paseo-bot[bot]