{"record":{"id":"d7e2969c34b12be3","repo":"nikivdev/code","slug":"no-prompt-provided","errorCode":null,"errorMessage":"No prompt provided.","messagePattern":"No prompt provided\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/agents.rs","lineNumber":319,"sourceCode":"        println!(\"fzf not found on PATH – install it to use fuzzy selection.\");\n        list_agents()?;\n        return Ok(());\n    }\n\n    if let Some(result) = run_agent_fzf(&entries)? {\n        let prompt_args = if result.with_args {\n            prompt_for_agent_prompt(&result.entry.name)?\n        } else if DIR_AGENTS.contains(&result.entry.name.as_str()) {\n            // Directory-based agents use cwd by default\n            let cwd = std::env::current_dir()\n                .map(|p| p.to_string_lossy().to_string())\n                .unwrap_or_else(|_| \".\".to_string());\n            vec![cwd]\n        } else {\n            prompt_for_agent_prompt(&result.entry.name)?\n        };\n        if prompt_args.is_empty() {\n            bail!(\"No prompt provided.\");\n        }\n        run_agent(&result.entry.name, prompt_args)?;\n    }\n\n    Ok(())\n}\n\n/// Copy agent instructions to clipboard.\nfn copy_agent_instructions(agent_name: Option<&str>) -> Result<()> {\n    let entries = build_agent_entries()?;\n    if entries.is_empty() {\n        println!(\"No agents available.\");\n        return Ok(());\n    }\n\n    let selected = if let Some(name) = agent_name {\n        // Find agent by name\n        entries","sourceCodeStart":301,"sourceCodeEnd":337,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/agents.rs#L301-L337","documentation":"run_flow_agent_capture_streaming (public API in src/agents.rs) streams agent output while capturing the final response. Like run_flow_agent_capture it unconditionally calls find_gen() and bails with the install message when the gen tool/repo cannot be found, before any streaming starts.","triggerScenarios":"Calling flow::agents::run_flow_agent_capture_streaming(prompt) when gen is not installed/locatable — error is raised immediately, prior to prompt validation or streaming.","commonSituations":"Same as run_flow_agent_capture: missing gen checkout on dev machine or CI; GEN_REPO not exported in the process environment (e.g. launched from a GUI app with a minimal environment).","solutions":["Install gen: cd <gen_repo_hint> && f install.","Export GEN_REPO pointing at the gen repo in the shell/profile that launches the program.","Pre-check gen availability (PATH/env) in the host application before invoking the streaming API."],"exampleFix":"// before (cron env lacks GEN_REPO)\n0 * * * * flow-stream-job\n// after\n+ 0 * * * * GEN_REPO=/home/user/src/gen flow-stream-job","handlingStrategy":"try-catch","validationCode":"if std::env::var(\"GEN_REPO\").is_err() && which::which(\"gen\").is_err() {\n    return Err(anyhow!(\"gen unavailable; export GEN_REPO first\"));\n}","typeGuard":null,"tryCatchPattern":"match agents::run_flow_agent_capture_streaming(prompt) {\n    Err(e) if e.to_string().contains(\"gen not found\") => {\n        eprintln!(\"streaming needs gen; install it or set GEN_REPO\");\n    }\n    Ok(text) => text,\n}","preventionTips":["Export GEN_REPO in non-interactive environments (cron, systemd, GUI launchers).","Bootstrap gen installation in CI before streaming jobs.","Check gen availability once at app startup, not per-call."],"tags":["missing-binary","gen","public-api","streaming"],"backgroundTag":"required-executable-not-on-path","analyzedSha":"a747e741ae92c09071d0ae946ab48488adcff1ce","analyzedAt":"2026-09-01T22:43:55.719Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}