zed-industries/zed · error · anyhow::Error
missing or invalid `request` field in config. Expected…
Error message
missing or invalid `request` field in config. Expected 'launch' or 'attach'
What it means
request_kind reads the debug config JSON to classify it as 'launch' or 'attach'; if the `request` field is missing or holds another value, the kind cannot be determined and this validation error is returned. The task's debug configuration JSON is the input at fault.
Solutions
- Set "request": "launch" or "attach" in the debug scenario/task JSON
- Fix typos in the request field of the adapter config
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at crates/dap/src/adapters.rs:379 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of zed-industries/zed@f4178619ac (2026-08-20).
Data as JSON: /api/errors/266bc80494345d1a.
Report an issue: GitHub.
Appendix: source
Thrown at crates/dap/src/adapters.rs:379
cx: &mut AsyncApp,
) -> Result<DebugAdapterBinary>;
/// Returns the language name of an adapter if it only supports one language
fn adapter_language_name(&self) -> Option<LanguageName> {
None
}
/// Extracts the kind (attach/launch) of debug configuration from the given JSON config.
/// This method should only return error when the kind cannot be determined for a given configuration;
/// in particular, it *should not* validate whether the request as a whole is valid, because that's best left to the debug adapter itself to decide.
async fn request_kind(
&self,
config: &serde_json::Value,
) -> Result<StartDebuggingRequestArgumentsRequest> {
match config.get("request") {
Some(val) if val == "launch" => Ok(StartDebuggingRequestArgumentsRequest::Launch),
Some(val) if val == "attach" => Ok(StartDebuggingRequestArgumentsRequest::Attach),
_ => Err(anyhow!(
"missing or invalid `request` field in config. Expected 'launch' or 'attach'"
)),
}
}
fn dap_schema(&self) -> serde_json::Value;
fn label_for_child_session(&self, _args: &StartDebuggingRequestArguments) -> Option<String> {
None
}
fn compact_child_session(&self) -> bool {
false
}
fn prefer_thread_name(&self) -> bool {
false
}View on GitHub (pinned to f4178619ac)