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

`run_slash_command` not available prior to v0.1.0

Error message

`run_slash_command` not available prior to v0.1.0

What it means

The host dispatches extension entry points through the versioned Extension enum (one variant per zed:api-version). run_slash_command was introduced in the WIT interface at v0.1.0, so dispatching it against a v0.0.1, v0.0.4, or v0.0.6 extension bails with this message instead of calling a non-existent export.

Source

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

            }
            Extension::V0_4_0(ext) => {
                ext.call_run_slash_command(store, command, arguments, resource)
                    .await
            }
            Extension::V0_3_0(ext) => {
                ext.call_run_slash_command(store, command, arguments, resource)
                    .await
            }
            Extension::V0_2_0(ext) => {
                ext.call_run_slash_command(store, command, arguments, resource)
                    .await
            }
            Extension::V0_1_0(ext) => {
                ext.call_run_slash_command(store, command, arguments, resource)
                    .await
            }
            Extension::V0_0_1(_) | Extension::V0_0_4(_) | Extension::V0_0_6(_) => {
                anyhow::bail!("`run_slash_command` not available prior to v0.1.0");
            }
        }
    }

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

View on GitHub (pinned to f4178619ac)

Solutions

  1. Update the offending extension to a release built with zed_extension_api >= 0.1.0 (rebuild + republish if you own it).
  2. In Cargo.toml of the extension, raise the dependency: zed_extension_api = "0.1.0" (or newer), then `cargo build --release`.
  3. If you cannot rebuild, remove the extension's slash_commands entries from its manifest so the host never dispatches the entry point.

Example fix

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

# after
[dependencies]
zed_extension_api = "0.1.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, 1, 0) {
    // do not dispatch run_slash_command; skip or prompt for an extension update
    return Ok(());
}

Type guard

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

Prevention

When it happens

Trigger: Zed invokes a slash command declared by an extension compiled against zed_extension_api 0.0.x; the host reaches the match arm for V0_0_1/V0_0_4/V0_0_6 in call_run_slash_command and bails.

Common situations: An old extension binary left installed after Zed added a feature that queries all extensions; a slash_commands manifest entry shipped by an extension that was never rebuilt with the newer API; mixed-version extension installs after an editor update.

Related errors


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