BoundaryML/baml · error

baml.toml [toolchain] selects channel

Error message

baml.toml [toolchain] selects channel {}, but no active concrete version is recorded locally.
Run: baml toolchain use {}

What it means

Fires during version resolution when the project's baml.toml [toolchain] names a channel (canary or nightly), but the local state file has no recorded concrete version for that channel. Channels are mutable aliases; the wrapper only stores the concrete version that was last resolved by `baml toolchain use`, so a fresh machine or a state file that never recorded the channel cannot resolve it.

Solutions

  1. Run `baml toolchain use <channel>` once to install and record a concrete version for the channel
  2. Verify the channel name in baml.toml [toolchain] is spelled exactly 'canary' or 'nightly'
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at baml_language/crates/baml/src/main.rs:622 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at baml_language/crates/baml/src/main.rs:622

    }
    if is_channel(&selector.selector) {
        let state = read_state();
        if let Some(channel) = state.channels.get(&selector.selector) {
            if channel
                .manifest_base_url
                .as_deref()
                .is_some_and(|base| base.trim_end_matches('/') != current_base)
            {
                return Err(anyhow!(
                    "channel {} was selected from a different manifest source.\nRun: baml toolchain use {} under the current manifest source.",
                    selector.selector,
                    selector.selector
                ));
            }
            return Ok(channel.active_version.clone());
        }
        return match &selector.source {
            SelectorSource::Project(path) => Err(anyhow!(
                "baml.toml [toolchain] selects channel {}, but no active concrete version is recorded locally.\nRun: baml toolchain use {}",
                selector.selector,
                selector.selector
            )
            .context(format!("project config: {}", path.display()))),
            _ => Err(anyhow!(
                "error: no BAML toolchain is installed.\nRun: baml toolchain use canary\nOr:  baml toolchain use nightly"
            )),
        };
    }
    Ok(selector.selector.clone())
}

fn missing_toolchain_error(selector: &ResolvedSelector, version: &str) -> anyhow::Error {
    let installed = installed_toolchains().join(", ");
    match &selector.source {
        SelectorSource::Project(path) => anyhow!(
            "{} [toolchain] pins version {version}, but it isn't installed.\nInstalled toolchains: {}\nRun: baml toolchain install {version}",

View on GitHub (pinned to bd85ce9dee)