Skip to content

fix(claude-tty): report an adapter error in its own words instead of "Internal error" - #145

Closed
sleeyax wants to merge 1 commit into
mainfrom
fix/claude-tty-request-errors
Closed

sleeyax wants to merge 1 commit into
mainfrom
fix/claude-tty-request-errors

Conversation

@sleeyax

@sleeyax sleeyax commented Oct 12, 2026

Copy link
Copy Markdown
Owner

Closes #139.

When a claude-tty request handler failed, Paseo showed only Internal error, even though the adapter had thrown an error that said what went wrong.

The adapter throws plain Errors. @agentclientprotocol/sdk answers any error that isn't a RequestError with JSON-RPC -32603 and the message Internal error, and puts the real text in data.details. Some Paseo daemons drop data entirely. Paseo 0.11.2 keeps it, but shows it behind the prefix: Internal error: Claude never took the prompt….

What this changes

  • Errors keep their own message (withRequestErrors in src/request-errors.ts): it wraps the agent before main.ts hands it to the SDK. When a handler throws, the error is rethrown as a RequestError whose message is the error's own text. A RequestError thrown on purpose passes through unchanged. Because there is one wrap point, no throw site changed.
  • The code stays -32603: Paseo 0.11.2 (providers/acp-agent.js) treats only -32602 differently, using it for its set-model fallback. With no data attached, it shows the message as-is.

Verification

  • New tests: one connects a client and the adapter through the SDK, sends a prompt to a session that doesn't exist, and checks the client gets Session missing not found. Without the wrapper, the same test gets Internal error. Another test checks that a RequestError passes through as it was thrown.
  • Checks: claude-tty-acp typecheck is clean and 247 tests pass.

Not covered

…"Internal error"

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sleeyax

sleeyax commented Oct 12, 2026

Copy link
Copy Markdown
Owner Author

Closing: Paseo already shows data.details (since at least 0.10.3), so this only drops the Internal error: prefix and doesn't fix the bare Internal error reported in #139.

@sleeyax sleeyax closed this Oct 12, 2026
@sleeyax
sleeyax deleted the fix/claude-tty-request-errors branch October 12, 2026 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

claude-tty: adapter errors reach Paseo as a bare "Internal error"

1 participant