Summary
ruff server assumes that every codeAction/resolve request contains a valid document URI in CodeAction.data.
If data is missing, null, not a URL string, or an invalid URL string, the server panics while preparing the background task and exits instead of returning InvalidParams.
I reproduced this on current main after a normal initialize request by sending:
{
"jsonrpc": "2.0",
"id": 2,
"method": "codeAction/resolve",
"params": {
"title": "Ruff: Fix all auto-fixable problems",
"kind": "source.fixAll.ruff"
}
}
These variants also crash:
"data": null
"data": {"uri": "file:///tmp/x.py"}
"data": "not-a-url"
Observed result:
ruff server exits with status 101
- stderr shows a panic from
crates/ruff_server/src/server/api/requests/code_action_resolve.rs
The root cause appears to be:
CodeActionResolve::document_url deserializes params.data.clone().unwrap_or_default() and calls expect(...)
- this happens during background task setup in
background_request_task, before the request-level catch_unwind
- the panic then propagates out of the main loop thread and exits the server
Expected result:
Malformed codeAction/resolve input should return InvalidParams instead of panicking or exiting the server.
One additional note: ruff server advertises codeActionProvider.resolveProvider = true unconditionally. I have not confirmed that a mainstream editor hits this path on its own, but a malformed codeAction/resolve request currently crashes the server.
Version
ruff 0.15.14
Source checkout: 0909c7ec2159 (main on 2026-05-23)
Summary
ruff serverassumes that everycodeAction/resolverequest contains a valid document URI inCodeAction.data.If
datais missing,null, not a URL string, or an invalid URL string, the server panics while preparing the background task and exits instead of returningInvalidParams.I reproduced this on current
mainafter a normalinitializerequest by sending:{ "jsonrpc": "2.0", "id": 2, "method": "codeAction/resolve", "params": { "title": "Ruff: Fix all auto-fixable problems", "kind": "source.fixAll.ruff" } }These variants also crash:
"data": null"data": {"uri": "file:///tmp/x.py"}"data": "not-a-url"Observed result:
ruff serverexits with status101crates/ruff_server/src/server/api/requests/code_action_resolve.rsThe root cause appears to be:
CodeActionResolve::document_urldeserializesparams.data.clone().unwrap_or_default()and callsexpect(...)background_request_task, before the request-levelcatch_unwindExpected result:
Malformed
codeAction/resolveinput should returnInvalidParamsinstead of panicking or exiting the server.One additional note:
ruff serveradvertisescodeActionProvider.resolveProvider = trueunconditionally. I have not confirmed that a mainstream editor hits this path on its own, but a malformedcodeAction/resolverequest currently crashes the server.Version
ruff 0.15.14Source checkout:
0909c7ec2159(mainon 2026-05-23)