Description
When rust-analyzer returns LSP error code -32802 ("server cancelled the request") with data: { retriggerRequest: true }, mcpls propagates this as an opaque LspServerError to the MCP caller. The retriggerRequest: true field signals that the client should retry the request once RA is stable, but mcpls ignores this hint entirely.
This affects real users: any hover/references/diagnostics call issued just after document open may silently return an error instead of retrying. The ra_e2e suite avoids this by polling until RA is stable before making tool calls, but live MCP clients don't have that luxury.
Reproduction Steps
- Open a document and immediately call
get_hover or get_diagnostics
- If RA is still indexing it returns
-32802 with retriggerRequest: true
- mcpls logs
ERROR LSP error response: server cancelled the request (code -32802) and returns an error
In tests: test_diagnostics_no_errors and test_diagnostics_with_error trigger this consistently.
Expected Behavior
When RA returns ServerCancelled with retriggerRequest: true, mcpls should retry the request (with backoff/timeout) before surfacing the error to the caller.
Actual Behavior
The error is propagated immediately to the MCP caller as LspServerError { code: -32802, message: "server cancelled the request" }.
Environment
- HEAD: 0f40608
- rust-analyzer: 1.95.0 (59807616 2026-04-14)
Logs / Evidence
ERROR mcpls_core::lsp::client: LSP error response: server cancelled the request (code -32802)
LSP response payload:
{"id":2,"error":{"code":-32802,"message":"server cancelled the request","data":{"retriggerRequest":true}}}
Reference
LSP 3.17 spec — ServerCancelled: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#errorCodes
Description
When rust-analyzer returns LSP error code -32802 ("server cancelled the request") with
data: { retriggerRequest: true }, mcpls propagates this as an opaqueLspServerErrorto the MCP caller. TheretriggerRequest: truefield signals that the client should retry the request once RA is stable, but mcpls ignores this hint entirely.This affects real users: any hover/references/diagnostics call issued just after document open may silently return an error instead of retrying. The ra_e2e suite avoids this by polling until RA is stable before making tool calls, but live MCP clients don't have that luxury.
Reproduction Steps
get_hoverorget_diagnostics-32802withretriggerRequest: trueERROR LSP error response: server cancelled the request (code -32802)and returns an errorIn tests:
test_diagnostics_no_errorsandtest_diagnostics_with_errortrigger this consistently.Expected Behavior
When RA returns
ServerCancelledwithretriggerRequest: true, mcpls should retry the request (with backoff/timeout) before surfacing the error to the caller.Actual Behavior
The error is propagated immediately to the MCP caller as
LspServerError { code: -32802, message: "server cancelled the request" }.Environment
Logs / Evidence
LSP response payload:
{"id":2,"error":{"code":-32802,"message":"server cancelled the request","data":{"retriggerRequest":true}}}Reference
LSP 3.17 spec —
ServerCancelled: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#errorCodes