[BUG] LSP tool failures are reported as success: no is_error on the result, telemetry tool_result success=true
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
When an LSP tool call fails, the result is reported as a success everywhere except in its text. The tool returns Error performing <operation>: …, but:
- the
tool_resultblock in the transcript has nois_error: true; - the OpenTelemetry
tool_resultevent hassuccess="true"and noerrorfield.
This happens for every kind of failure we see: the server rejecting a request, the server process exiting, a file sync failing (Failed to sync file open …: Cannot send notification to LSP server …). Over three days on our machines all 209 tool_result events for LSP had success="true", while 14 of the matching transcript results were Error performing …. Anything that counts tool failures from telemetry (or from is_error) never sees LSP failures, and the model gets an error with no error flag.
What Should Happen?
A failed LSP operation should be marked like any other failed tool call: is_error: true on the tool result, and success="false" with the error text in the telemetry tool_result event.
Error Messages/Logs
# transcript tool_result (is_error absent)
Error performing findReferences: Failed to sync file open /…/use-inquiries.ts: Cannot send notification to LSP server '…'
# OTel event for the same call
{"event.name":"tool_result","tool_name":"LSP","success":"true","duration_ms":"36","tool_result_size_bytes":"200"}
Steps to Reproduce
- Configure any plugin LSP server whose process exits on a request (or returns a JSON-RPC error for it).
- Ask Claude to run that LSP operation, e.g.
findReferenceson a file of that language. - The tool returns
Error performing findReferences: …. - In the transcript the
tool_resulthas nois_error; withCLAUDE_CODE_ENABLE_TELEMETRY=1and logs exported, thetool_resultevent forLSPhassuccess="true".
Claude Model
Not sure / Multiple models
Is this a regression?
I don't know
Claude Code Version
2.1.284 (Claude Code)
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
Other