{"record":{"id":"28c83c097fc2c4bf","repo":"nikivdev/code","slug":"hive-not-found-on-path-install-from-https-githu","errorCode":null,"errorMessage":"hive not found on PATH. Install from https://github.com/example/hive","messagePattern":"hive not found on PATH\\. Install from https://github\\.com/example/hive","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/hive.rs","lineNumber":311,"sourceCode":"                    spec_path: None,\n                    config: AgentConfig {\n                        name,\n                        description: spec.job.or(spec.prompt),\n                        ..Default::default()\n                    },\n                });\n            }\n        }\n    }\n\n    agents\n}\n\n/// Run a hive agent with a prompt\npub fn run_agent(agent: &str, prompt: &str) -> Result<()> {\n    // Check if hive is available\n    if which::which(\"hive\").is_err() {\n        anyhow::bail!(\"hive not found on PATH. Install from https://github.com/example/hive\");\n    }\n\n    let status = Command::new(\"hive\")\n        .arg(\"agent\")\n        .arg(agent)\n        .arg(prompt)\n        .stdin(Stdio::inherit())\n        .stdout(Stdio::inherit())\n        .stderr(Stdio::inherit())\n        .status()\n        .context(\"Failed to run hive\")?;\n\n    if !status.success() {\n        anyhow::bail!(\n            \"hive agent '{}' exited with status {:?}\",\n            agent,\n            status.code()\n        );","sourceCodeStart":293,"sourceCodeEnd":329,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/hive.rs#L293-L329","documentation":"`run_agent` launches an external `hive` CLI in agent mode (`hive agent <agent> <prompt>`). Before doing so it probes `PATH` with the `which` crate; if `hive` isn't found it bails with this message, which includes the (placeholder) install URL. The error occurs before any subprocess is spawned.","triggerScenarios":"Calling `run_agent` on a machine where no `hive` executable is on PATH; running inside an environment with a stripped PATH (cron, CI containers); hive installed under a non-PATH directory.","commonSituations":"Fresh dev machine without hive installed; Docker image missing the hive dependency; virtualenv/conda/nix shell that shadows or omits PATH entries; typo in install location so the binary is named differently.","solutions":["Install hive per the URL in the message, then verify with `which hive`","If already installed, add its directory to PATH: `export PATH=\"$PATH:/path/to/hive/bin\"`","Run in an environment that inherits your PATH (avoid bare `env -i`, check cron/CI PATH)","Confirm the binary name is exactly `hive` (create a symlink if installed under another name)"],"exampleFix":"// before (call without checking)\nhive::run_agent(\"reviewer\", \"review this PR\")?;\n// after\nif which::which(\"hive\").is_err() {\n    eprintln!(\"hive missing; skipping agent step\");\n    return Ok(()); // or install hint\n}\nhive::run_agent(\"reviewer\", \"review this PR\")?;","handlingStrategy":"validation","validationCode":"if which::which(\"hive\").is_err() {\n    eprintln!(\"hive is required but not on PATH. Install it first.\");\n    std::process::exit(127);\n}","typeGuard":"fn hive_available() -> bool {\n    which::which(\"hive\").is_ok()\n}","tryCatchPattern":"match hive::run_agent(agent, prompt) {\n    Err(e) if e.to_string().contains(\"hive not found\") => {\n        eprintln!(\"skipping agent step: install hive from the linked URL\");\n        // degrade or abort depending on whether the agent step is mandatory\n    }\n    r => r?,\n}","preventionTips":["Install hive as part of machine/bootstrap setup and verify with `which hive`","Keep PATH intact in CI and cron (avoid `env -i`; export PATH explicitly)","Add a preflight dependency check at CLI startup for all external tools","Document required externals and their install URLs in the README"],"tags":["path","external-binary","cli","rust"],"backgroundTag":"command-not-found","analyzedSha":"a747e741ae92c09071d0ae946ab48488adcff1ce","analyzedAt":"2026-09-01T22:43:55.719Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}