{"record":{"id":"5bf04847a6e0e73d","repo":"zed-industries/zed","slug":"zed-cannot-determine-how-to-run-this-debug-scenari","errorCode":null,"errorMessage":"Zed cannot determine how to run this debug scenario. `build` field was not provided and Debug Adapter won't accept provided configuration because: {e}","messagePattern":"Zed cannot determine how to run this debug scenario\\. `build` field was not provided and Debug Adapter won't accept provided configuration because: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/debugger_ui/src/session/running.rs","lineNumber":1270,"sourceCode":"                    label: label.clone(),\n                    adapter: adapter.clone(),\n                    request,\n                    stop_on_entry: None,\n                };\n\n                let scenario = dap_registry\n                    .adapter(&adapter)\n                    .with_context(|| anyhow!(\"{adapter}: is not a valid adapter name\"))?.config_from_zed_format(zed_config)\n                    .await?;\n                config = scenario.config;\n                util::merge_non_null_json_value_into(extra_config, &mut config);\n\n                Self::substitute_variables_in_config(&mut config, &task_context);\n            } else {\n                let Err(e) = request_type else {\n                    unreachable!();\n                };\n                anyhow::bail!(\"Zed cannot determine how to run this debug scenario. `build` field was not provided and Debug Adapter won't accept provided configuration because: {e}\");\n            };\n\n            Ok(DebugTaskDefinition {\n                label,\n                adapter: DebugAdapterName(adapter),\n                config,\n                tcp_connection,\n            })\n        })\n    }\n\n    fn handle_run_in_terminal(\n        &self,\n        request: &RunInTerminalRequestArguments,\n        mut sender: mpsc::Sender<Result<u32>>,\n        window: &mut Window,\n        cx: &mut Context<Self>,\n    ) -> Task<Result<()>> {","sourceCodeStart":1252,"sourceCodeEnd":1288,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/debugger_ui/src/session/running.rs#L1252-L1288","documentation":"Terminal fallback diagnostic: when the scenario's config is invalid (`config_is_valid == false`), no `build`/locator output exists to repair it, and the adapter's `request_kind()` rejected the config with error `e`, Zed reports that it has no way to run the scenario and embeds the adapter's rejection reason (running.rs:1270). `e` names the concrete missing/invalid field.","triggerScenarios":"E.g. a Python config missing `program` or with a bad `request` value, a Node config missing `program`, wrong-typed fields (port as string), or unknown keys the adapter rejects — combined with no `build` field that could supply a locator instead.","commonSituations":"Hand-written debug.json missing required fields; pasting VS Code launch.json sections that use keys the adapter does not accept; typos in `request` (`\"lauch\"`); migrating configs between Zed versions where adapter requirements tightened.","solutions":["Read the `{e}` suffix — it is the adapter's own validation error naming the missing/invalid field; fix that field first.","Add the required fields (Python: `request` + `program`; Node: `program`; etc.) to `config`.","Alternatively add a `build` task to the scenario so Zed can derive a locator even when the raw config is incomplete.","Validate the config against the adapter's documented schema before saving."],"exampleFix":"// before\n{\n  \"adapter\": \"Python\",\n  \"label\": \"Debug main\",\n  \"config\": { \"request\": \"launch\" }\n}\n\n// after\n{\n  \"adapter\": \"Python\",\n  \"label\": \"Debug main\",\n  \"config\": { \"request\": \"launch\", \"program\": \"$ZED_FILE\", \"console\": \"integratedTerminal\" }\n}","handlingStrategy":"validation","validationCode":"// validate adapter-required fields before the session starts\nlet request = config.get(\"request\").and_then(|v| v.as_str());\nif !matches!(request, Some(\"launch\") | Some(\"attach\")) {\n    return Err(anyhow!(\"config must set request to launch or attach\"));\n}\nif adapter_needs_program(&adapter) && config.get(\"program\").is_none() {\n    return Err(anyhow!(\"config for {adapter} requires `program`\"));\n}","typeGuard":"fn is_minimally_valid_debug_config(adapter: &str, config: &serde_json::Value) -> bool {\n    let request_ok = config\n        .get(\"request\")\n        .and_then(|v| v.as_str())\n        .is_some_and(|r| r == \"launch\" || r == \"attach\");\n    let program_ok = !adapter_requires_program(adapter) || config.get(\"program\").is_some();\n    request_ok && program_ok\n}","tryCatchPattern":"Run adapter `request_kind` eagerly at config-edit time, catch its Err, and display that reason inline — this is exactly the `{e}` the runtime error embeds, surfaced before launch.","preventionTips":["Start from a working example config per adapter and change one field at a time.","Prefer adding a `build` task when the config cannot be fully valid on its own.","Validate configs in CI with the same adapter schema checks."],"tags":["debugger","configuration","dap","validation","zed"],"backgroundTag":"invalid-debug-config","analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}