{"record":{"id":"d5036df9f05efa76","repo":"helix-editor/helix","slug":"dap-request-failed","errorCode":null,"errorMessage":"DAP request failed","messagePattern":"DAP request failed","errorType":"exception","errorClass":"helix_dap::Error","httpStatus":null,"severity":"error","filePath":"helix-dap/src/client.rs","lineNumber":294,"sourceCode":"                arguments,\n            };\n\n            server_tx\n                .send(Payload::Request(req))\n                .map_err(|e| Error::Other(e.into()))?;\n\n            // TODO: specifiable timeout, delay other calls until initialize success\n            let response = timeout(Duration::from_secs(20), callback_rx.recv())\n                .await\n                .map_err(|_| Error::Timeout(id))? // return Timeout\n                .ok_or(Error::StreamClosed)??;\n\n            if !response.success {\n                let message = response\n                    .message\n                    .clone()\n                    .unwrap_or_else(|| \"DAP request failed\".to_string());\n                return Err(Error::Other(anyhow!(message)));\n            }\n\n            Ok(response.body.unwrap_or_default())\n        }\n    }\n\n    pub async fn request<R: helix_dap_types::Request>(\n        &self,\n        params: R::Arguments,\n    ) -> Result<R::Result>\n    where\n        R::Arguments: serde::Serialize,\n    {\n        // a future that resolves into the response\n        let json = self.call::<R>(params).await?;\n        let response = serde_json::from_value(json)?;\n        Ok(response)\n    }","sourceCodeStart":276,"sourceCodeEnd":312,"githubUrl":"https://github.com/helix-editor/helix/blob/079a789e8cb08ead67f19e1971a1b7438b37354b/helix-dap/src/client.rs#L276-L312","documentation":"Fallback message used when a Debug Adapter Protocol response arrives with success = false and the adapter supplied no human-readable 'message' field. It is wrapped as Error::Other(anyhow!(message)) after the 20s timeout and stream-closed checks already passed, so the request reached the adapter and was explicitly rejected.","triggerScenarios":"Any dap::Client::request call whose response has success:false and message:None - commonly setBreakpoints before the adapter finished initializing, evaluate/continue while no thread is stopped, or a request the adapter lacks the capability for (checked against caps elsewhere).","commonSituations":"Race at session start: Helix sends a request before the initialize/launch handshake completes; adapter version change removed support for a request (e.g. unsupported breakpoint features); adapter-specific quirks (lldb-dap vs codelldb vs debugpy) rejecting arguments like invalid paths or 0-based/1-based line mismatches.","solutions":["Check the adapter's own log/stderr for the real rejection reason - this message means the adapter sent no explanation","Rule out the startup race: retry the operation after the session is fully initialized/launched (e.g. set breakpoints after 'stopped' or launch completes)","Verify the arguments (file paths must exist and be absolute; line numbers are converted internally) and the adapter's capabilities before issuing optional requests","Update or switch the adapter (e.g. codelldb <-> lldb-dap) if the request is unsupported in your version"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Before optional requests, gate on the adapter's capabilities:\nif let Some(caps) = debugger.caps() {\n    if !caps.supports_configuration_done_request.unwrap_or(false) {\n        return Ok(()); // adapter will reject it\n    }\n}","typeGuard":null,"tryCatchPattern":"// All dap::Client request wrappers return Result; handle Error::Other and\n// keep the session alive - show the message but don't tear down:\nmatch debugger.set_breakpoints(path, bps).await {\n    Ok(_) => {}\n    Err(dap::Error::Other(e)) => status_msg(format!(\"debugger rejected request: {e}\")),\n    Err(dap::Error::Timeout(_)) => retry_once().await,\n    Err(dap::Error::StreamClosed) => restart_session(),\n}","preventionTips":["Wait for initialize/launch/configurationDone before sending requests","Check capabilities (caps) before optional requests (eval, conditional bps)","Run the adapter with its own log enabled so rejections carry a real reason","Treat this error as adapter-specific: reproduce outside Helix before filing bugs"],"tags":["rust","helix","dap","debugging","protocol"],"backgroundTag":null,"analyzedSha":"079a789e8cb08ead67f19e1971a1b7438b37354b","analyzedAt":"2026-08-16T09:09:59.668Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}