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

`context_server_command` not available prior to v0.2.0

Error message

`context_server_command` not available prior to v0.2.0

What it means

The Extension enum dispatch in call_context_server_command requires the v0.2.0 or newer WIT interface. Context-server command support was added at v0.2.0, so an extension compiled against v0.0.1 through v0.1.0 hits the bail arm instead of a missing export.

Source

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

                    .await
            }
            Extension::V0_4_0(ext) => {
                ext.call_context_server_command(store, &context_server_id, project)
                    .await
            }
            Extension::V0_3_0(ext) => {
                ext.call_context_server_command(store, &context_server_id, project)
                    .await
            }
            Extension::V0_2_0(ext) => Ok(ext
                .call_context_server_command(store, &context_server_id, project)
                .await?
                .map(Into::into)),
            Extension::V0_0_1(_)
            | Extension::V0_0_4(_)
            | Extension::V0_0_6(_)
            | Extension::V0_1_0(_) => {
                anyhow::bail!("`context_server_command` not available prior to v0.2.0");
            }
        }
    }

    pub async fn call_context_server_configuration(
        &self,
        store: &mut Store<WasmState>,
        context_server_id: Arc<str>,
        project: Resource<ExtensionProject>,
    ) -> Result<Result<Option<ContextServerConfiguration>, String>> {
        match self {
            Extension::V0_8_0(ext) => {
                ext.call_context_server_configuration(store, &context_server_id, project)
                    .await
            }
            Extension::V0_6_0(ext) => {
                ext.call_context_server_configuration(store, &context_server_id, project)
                    .await

View on GitHub (pinned to f4178619ac)

Solutions

  1. Bump zed_extension_api in the extension's Cargo.toml to >= 0.2.0 and rebuild (`cargo build --release`).
  2. Reinstall/republish the extension so the new wasm is loaded.
  3. If a third party owns it, update to their latest release or open an issue.

Example fix

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

# after
[dependencies]
zed_extension_api = "0.2.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, 2, 0) {
    // extension cannot serve context server commands; skip it
    return Ok(());
}

Type guard

fn supports_context_server_command(ext: &Extension) -> bool {
    !matches!(
        ext,
        Extension::V0_0_1(_)
            | Extension::V0_0_4(_)
            | Extension::V0_0_6(_)
            | Extension::V0_1_0(_)
    )
}

Prevention

When it happens

Trigger: Zed resolves a context server command from an extension whose wasm declares zed:api-version < 0.2.0, reaching the V0_0_1/V0_0_4/V0_0_6/V0_1_0 arm of call_context_server_command.

Common situations: Using a stale extension release after adding context servers to its manifest; testing a local build pinned to an old zed_extension_api; an MCP/context-server feature enabled against an extension built before that API existed.

Related errors


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