nikivdev/code · error

No profile selected.

Error message

No profile selected.

What it means

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).

Source

Thrown at src/agents.rs:273

    }
}

fn prompt_agents_profile(profiles: &[String]) -> Result<String> {
    println!("Select an agents profile:");
    for (index, profile) in profiles.iter().enumerate() {
        println!("  {}) {}", index + 1, profile);
    }
    print!("choice> ");
    io::stdout().flush()?;

    let stdin = io::stdin();
    let line = stdin.lock().lines().next();
    let input = match line {
        Some(Ok(value)) => value.trim().to_string(),
        _ => "".to_string(),
    };
    if input.is_empty() {
        bail!("No profile selected.");
    }
    let idx: usize = input.parse().context("invalid selection")?;
    if idx == 0 || idx > profiles.len() {
        bail!("Selection out of range.");
    }
    Ok(profiles[idx - 1].clone())
}

struct AgentEntry {
    name: String,
    display: String,
    path: Option<PathBuf>,
}

struct FzfAgentResult<'a> {
    entry: &'a AgentEntry,
    with_args: bool,
}

View on GitHub (pinned to a747e741ae)

Solutions

  1. Install gen: cd <gen_repo_hint> && f install, or set GEN_REPO to the gen repo path.
  2. Fix the agent config tool value to "claude" or "opencode" if gen was not intended.
  3. Check get_agent_config source (env/config file) for a typo in the tool name.

Example fix

// before (config)
tool = "gen"
// after (either install gen)
+ export GEN_REPO=~/src/gen
+ flow agent review "..."
// or switch tool
+ tool = "opencode"
Defensive patterns

Strategy: validation

Validate before calling

// ensure tool config resolves before invoking
let tool = std::env::var("FLOW_AGENT_TOOL").unwrap_or_default();
if !matches!(tool.as_str(), "claude" | "opencode")
    && which::which("gen").is_err() && std::env::var("GEN_REPO").is_err() {
    eprintln!("tool={tool} requires gen; install gen or set GEN_REPO");
}

Try / catch

match run_agent(name, prompt) {
    Err(e) if e.to_string().contains("gen not found") => {
        eprintln!("install gen or set GEN_REPO, or configure tool=claude|opencode");
    }
    r => r?,
}

Prevention

When it happens

Trigger: Invoking an agent whose configured tool string (from get_agent_config) is not "claude" or "opencode", while the gen binary/repo cannot be located.

Common situations: 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.

Related errors


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