nikivdev/code · error

hive not found on PATH

Error message

hive not found on PATH

What it means

`run_agent_interactive` runs `hive agent <agent>` with inherited stdin/stdout/stderr so the user can type the prompt interactively. Like `run_agent`, it first probes for `hive` on PATH and bails with this shorter message if the binary is absent. The error fires before the subprocess starts.

Source

Thrown at src/hive.rs:338

        .stderr(Stdio::inherit())
        .status()
        .context("Failed to run hive")?;

    if !status.success() {
        anyhow::bail!(
            "hive agent '{}' exited with status {:?}",
            agent,
            status.code()
        );
    }

    Ok(())
}

/// Run an agent interactively (prompt via stdin)
pub fn run_agent_interactive(agent: &str) -> Result<()> {
    if which::which("hive").is_err() {
        anyhow::bail!("hive not found on PATH");
    }

    let status = Command::new("hive")
        .arg("agent")
        .arg(agent)
        .stdin(Stdio::inherit())
        .stdout(Stdio::inherit())
        .stderr(Stdio::inherit())
        .status()
        .context("Failed to run hive")?;

    if !status.success() {
        anyhow::bail!(
            "hive agent '{}' exited with status {:?}",
            agent,
            status.code()
        );
    }

View on GitHub (pinned to a747e741ae)

Solutions

  1. Install hive and confirm with `which hive`
  2. Add hive's install directory to PATH in your shell profile
  3. Run inside a normal interactive shell that inherits your full PATH
  4. Symlink the binary into a PATH directory if it is installed under a non-standard name/path

Example fix

# before
f agent reviewer   # interactive, hive missing
# after
export PATH="$PATH:$HOME/.local/bin"  # where hive lives
which hive && f agent reviewer
Defensive patterns

Strategy: validation

Validate before calling

if which::which("hive").is_err() {
    eprintln!("hive is not installed or not on PATH; install it before using interactive agents");
    std::process::exit(127);
}

Type guard

fn hive_available() -> bool {
    which::which("hive").is_ok()
}

Try / catch

if !hive_available() {
    eprintln!("hive missing — skipping interactive agent");
    return Ok(()); // or prompt to install
}
hive::run_agent_interactive(agent)?;

Prevention

When it happens

Trigger: Invoking the interactive agent flow where `hive` is not installed or not reachable via the current PATH (bare env, restricted shell, container).

Common situations: Same as the non-interactive case: fresh machine without hive; CI/cron environments with minimal PATH; nix/venv shells excluding the hive install dir.

Related errors


AI-assisted analysis of nikivdev/code@a747e741ae (2026-09-01). Data as JSON: /api/errors/5f5362425d457212. Report an issue: GitHub.