BoundaryML/baml · error

baml ide install needs a managed BAML toolchain, but the act

Error message

baml ide install needs a managed BAML toolchain, but the active one is a local binary at {}.
The VS Code extension ships with released toolchains only.
Run: baml toolchain use canary

What it means

When the toolchain root exists but assets/baml-vscode.vsix is missing, `active_toolchain_vsix` checks BAML_WRAPPER_LOCAL_TOOLCHAIN. If set, the active toolchain is a local dev build, so it errors explaining that `baml ide install` requires a managed (released) toolchain which is the only one shipping the VS Code extension.

Source

Thrown at baml_language/crates/baml_cli/src/ide_command.rs:214

  3. Select the saved baml-vscode.vsix."#,
        dir = os.example_dir(),
        chord = os.palette_chord(),
    )
}

fn active_toolchain_vsix() -> Result<PathBuf> {
    let exe = env::current_exe().context("failed to locate baml-cli executable")?;
    let toolchain_root = exe
        .parent()
        .and_then(Path::parent)
        .ok_or_else(|| anyhow!("failed to determine active BAML toolchain root"))?;
    let vsix = toolchain_root.join("assets").join("baml-vscode.vsix");
    if !vsix.exists() {
        // A local build has no assets/ next to it, so say that plainly rather
        // than reporting a missing file the developer never expected to exist.
        if let Some(local) = env::var_os("BAML_WRAPPER_LOCAL_TOOLCHAIN") {
            anyhow::bail!(
                "baml ide install needs a managed BAML toolchain, but the active one is a local binary at {}.\nThe VS Code extension ships with released toolchains only.\nRun: baml toolchain use canary",
                Path::new(&local).display()
            );
        }
        anyhow::bail!(
            "active BAML toolchain does not include assets/baml-vscode.vsix at {}",
            vsix.display()
        );
    }
    Ok(vsix)
}

fn command_on_path(command: &str) -> Option<OsString> {
    let path = env::var_os("PATH")?;
    for dir in env::split_paths(&path) {
        #[cfg(windows)]
        {
            let candidate = dir.join(format!("{command}.cmd"));

View on GitHub (pinned to bd85ce9dee)

Solutions

  1. Switch to a released toolchain: run `baml toolchain use canary`, then retry `baml ide install`
  2. Unset BAML_WRAPPER_LOCAL_TOOLCHAIN if you meant to use a managed toolchain
  3. For local development, install the extension manually by building the vsix from the vscode extension sources

Example fix

// before
$ BAML_WRAPPER_LOCAL_TOOLCHAIN=/home/me/baml/target/debug ./baml ide install
// after
$ baml toolchain use canary
$ baml ide install
Defensive patterns

Strategy: validation

Validate before calling

# detect a local toolchain before attempting ide install
if [ -n "$BAML_WRAPPER_LOCAL_TOOLCHAIN" ]; then
  echo "local build: install the extension manually; run: baml toolchain use canary"
  exit 1
fi

Try / catch

if let Err(e) = result {
    if e.to_string().contains("local binary") {
        eprintln!("Switch to a managed toolchain with: baml toolchain use canary");
    }
}

Prevention

When it happens

Trigger: Running `baml ide install` while BAML_WRAPPER_LOCAL_TOOLCHAIN points at a locally built baml binary whose directory has no assets/baml-vscode.vsix.

Common situations: Developers testing a locally built BAML binary that attempts to install the IDE extension; local builds never bundle the vsix asset.

Related errors


AI-assisted analysis of BoundaryML/baml@bd85ce9dee (2026-09-12). Data as JSON: /api/errors/0b8c37f638379f69. Report an issue: GitHub.