zed-industries/zed · error · anyhow::Error

`get_dap_binary` not available prior to v0.6.0

Error message

`get_dap_binary` not available prior to v0.6.0

What it means

Debug-adapter support calls into extensions via call_get_dap_binary, an export that exists only from WIT v0.6.0. Extensions compiled against v0.0.1 through v0.5.0 hit the bail arm listing all too-old variants.

Source

Thrown at crates/extension_host/src/wasm_host/wit.rs:1097

                        &adapter_name,
                        &task.into(),
                        user_installed_path.as_ref().and_then(|p| p.to_str()),
                        resource,
                    )
                    .await?
                    .map_err(|e| anyhow!("{e:?}"))?;

                Ok(Ok(dap_binary.into()))
            }
            Extension::V0_5_0(_)
            | Extension::V0_4_0(_)
            | Extension::V0_3_0(_)
            | Extension::V0_2_0(_)
            | Extension::V0_1_0(_)
            | Extension::V0_0_6(_)
            | Extension::V0_0_4(_)
            | Extension::V0_0_1(_) => {
                anyhow::bail!("`get_dap_binary` not available prior to v0.6.0");
            }
        }
    }

    pub async fn call_dap_request_kind(
        &self,
        store: &mut Store<WasmState>,
        adapter_name: Arc<str>,
        config: serde_json::Value,
    ) -> Result<Result<StartDebuggingRequestArgumentsRequest, String>> {
        match self {
            Extension::V0_8_0(ext) => {
                let config =
                    serde_json::to_string(&config).context("Adapter config is not a valid JSON")?;
                let dap_binary = ext
                    .call_dap_request_kind(store, &adapter_name, &config)
                    .await?
                    .map_err(|e| anyhow!("{e:?}"))?;

View on GitHub (pinned to f4178619ac)

Solutions

  1. Bump zed_extension_api to >= 0.6.0 in the extension's Cargo.toml, update Cargo.lock, and rebuild.
  2. Install the latest published version of the debug adapter extension.
  3. Until rebuilt, configure the adapter outside the extension (e.g. a user-provided binary path).

Example fix

# before (extension Cargo.toml)
[dependencies]
zed_extension_api = "0.5.0"

# after
[dependencies]
zed_extension_api = "0.6.0"
Defensive patterns

Strategy: validation

Validate before calling

let api_version = extension_host::parse_wasm_extension_version(extension_id, &wasm_bytes)?;
if api_version < semver::Version::new(0, 6, 0) {
    // adapter cannot supply a binary; require a user-configured path instead
    anyhow::bail!("debug adapter extension requires api-version >= 0.6.0");
}

Type guard

fn supports_get_dap_binary(ext: &Extension) -> bool {
    !matches!(
        ext,
        Extension::V0_0_1(_)
            | Extension::V0_0_4(_)
            | Extension::V0_0_6(_)
            | Extension::V0_1_0(_)
            | Extension::V0_2_0(_)
            | Extension::V0_3_0(_)
            | Extension::V0_4_0(_)
            | Extension::V0_5_0(_)
    )
}

Prevention

When it happens

Trigger: Starting a debug session with a debug adapter declared by an extension built with zed_extension_api < 0.6.0; the host tries to fetch the DAP binary from the extension and bails.

Common situations: Debug-adapter extensions built before the v0.6.0 DAP interface shipped; local extension development with a stale Cargo.lock pinning an older API version.

Related errors


AI-assisted analysis of zed-industries/zed@f4178619ac (2026-08-20). Data as JSON: /api/errors/3dcbb2ce7ce49dc0. Report an issue: GitHub.