{"record":{"id":"628080d93f02a345","repo":"nikivdev/code","slug":"no-profile-selected","errorCode":null,"errorMessage":"No profile selected.","messagePattern":"No profile selected\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/agents.rs","lineNumber":273,"sourceCode":"    }\n}\n\nfn prompt_agents_profile(profiles: &[String]) -> Result<String> {\n    println!(\"Select an agents profile:\");\n    for (index, profile) in profiles.iter().enumerate() {\n        println!(\"  {}) {}\", index + 1, profile);\n    }\n    print!(\"choice> \");\n    io::stdout().flush()?;\n\n    let stdin = io::stdin();\n    let line = stdin.lock().lines().next();\n    let input = match line {\n        Some(Ok(value)) => value.trim().to_string(),\n        _ => \"\".to_string(),\n    };\n    if input.is_empty() {\n        bail!(\"No profile selected.\");\n    }\n    let idx: usize = input.parse().context(\"invalid selection\")?;\n    if idx == 0 || idx > profiles.len() {\n        bail!(\"Selection out of range.\");\n    }\n    Ok(profiles[idx - 1].clone())\n}\n\nstruct AgentEntry {\n    name: String,\n    display: String,\n    path: Option<PathBuf>,\n}\n\nstruct FzfAgentResult<'a> {\n    entry: &'a AgentEntry,\n    with_args: bool,\n}","sourceCodeStart":255,"sourceCodeEnd":291,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/agents.rs#L255-L291","documentation":"run_agent in src/agents.rs dispatches to a configured tool; when the configured tool is neither \"claude\" nor \"opencode\" it falls back to invoking `gen`, and bails with the same install message if find_gen() returns None. This is the runtime-invoke counterpart of the entry-list error (agents.rs:776).","triggerScenarios":"Invoking an agent whose configured tool string (from get_agent_config) is not \"claude\" or \"opencode\", while the gen binary/repo cannot be located.","commonSituations":"Config file setting tool to \"gen\" or a custom value on a machine without the gen repo; GEN_REPO unset after a machine migration; typo'd tool name in config silently falling through to the gen branch.","solutions":["Install gen: cd <gen_repo_hint> && f install, or set GEN_REPO to the gen repo path.","Fix the agent config tool value to \"claude\" or \"opencode\" if gen was not intended.","Check get_agent_config source (env/config file) for a typo in the tool name."],"exampleFix":"// before (config)\ntool = \"gen\"\n// after (either install gen)\n+ export GEN_REPO=~/src/gen\n+ flow agent review \"...\"\n// or switch tool\n+ tool = \"opencode\"","handlingStrategy":"validation","validationCode":"// ensure tool config resolves before invoking\nlet tool = std::env::var(\"FLOW_AGENT_TOOL\").unwrap_or_default();\nif !matches!(tool.as_str(), \"claude\" | \"opencode\")\n    && which::which(\"gen\").is_err() && std::env::var(\"GEN_REPO\").is_err() {\n    eprintln!(\"tool={tool} requires gen; install gen or set GEN_REPO\");\n}","typeGuard":null,"tryCatchPattern":"match run_agent(name, prompt) {\n    Err(e) if e.to_string().contains(\"gen not found\") => {\n        eprintln!(\"install gen or set GEN_REPO, or configure tool=claude|opencode\");\n    }\n    r => r?,\n}","preventionTips":["Set agent tool explicitly to \"claude\" or \"opencode\" in config to avoid the gen fallback.","Install gen wherever the tool value is gen/custom.","Verify config after machine migrations (GEN_REPO path changes)."],"tags":["missing-binary","environment-variable","gen","config"],"backgroundTag":"required-executable-not-on-path","analyzedSha":"a747e741ae92c09071d0ae946ab48488adcff1ce","analyzedAt":"2026-09-01T22:43:55.719Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}