Skip to main content

ensure_installed_with

Function ensure_installed_with 

Source
pub async fn ensure_installed_with<F>(
    paths: DataPaths,
    req: NpmInstallRequest,
    wait: Duration,
    install: F,
) -> Result<PathBuf, EnsureError>
Expand description

The pinned CLI for a provider whose install is missing: install it, waiting up to wait. install is injected so tests don’t need npm.

This is what the UI’s launch flow does on a pin bump (ResolveCli installs and waits). agent.open used to refuse instead, with CLI_NOT_AVAILABLE, for the minute or two after an upgrade while the new pin downloaded.