nikivdev/code · error

empty resolver command for {}

Error message

empty resolver command for {}

What it means

External session resolvers are configured as command-line strings. The tool splits the command with `shell_words::split`; if the split yields no tokens (empty or whitespace-only command), it cannot spawn a process and bails naming the resolver.

Source

Thrown at src/ai.rs:12576

    for candidate in candidates {
        if !resolver
            .matches
            .iter()
            .any(|pattern| wildcard_match(pattern, candidate))
        {
            continue;
        }

        let command_text = render_reference_resolver_command(
            &resolver.command,
            candidate,
            query_text,
            target_path,
        );
        let args = shell_words::split(&command_text)
            .with_context(|| format!("invalid resolver command: {}", command_text))?;
        let Some((program, rest)) = args.split_first() else {
            bail!("empty resolver command for {}", resolver.name);
        };
        let output = Command::new(program)
            .args(rest)
            .current_dir(target_path)
            .output()
            .with_context(|| format!("failed to run resolver {}", resolver.name))?;
        if !output.status.success() {
            let stderr = String::from_utf8_lossy(&output.stderr).trim().to_string();
            bail!(
                "resolver {} failed for {}: {}",
                resolver.name,
                candidate,
                if stderr.is_empty() {
                    format!("exit status {}", output.status)
                } else {
                    stderr
                }
            );

View on GitHub (pinned to a747e741ae)

Solutions

  1. Set a real command for the resolver in config (e.g. `fzf ...` or a script path)
  2. Remove the empty resolver entry entirely if unneeded
  3. Check whether env expansion emptied the command and fix the variable

Example fix

// before (config)
[[resolver]]
name = "pick"
command = ""
// after
[[resolver]]
name = "pick"
command = "f codex sessions --json | fzf"
Defensive patterns

Strategy: validation

Validate before calling

if resolver.command.trim().is_empty() {
    eprintln!("resolver '{}' has an empty command", resolver.name);
    return;
}
let args = shell_words::split(&resolver.command)?;
if args.is_empty() { eprintln!("resolver command splits to nothing"); return; }

Type guard

fn resolver_command_ok(cmd: &str) -> bool {
    shell_words::split(cmd).map(|a| !a.is_empty()).unwrap_or(false)
}

Prevention

When it happens

Trigger: A resolver entry whose command text is empty after trimming — e.g. a config file with `command = ""`, or a command consisting solely of comments/whitespace.

Common situations: Mis-edited config where the command line was deleted but the resolver entry kept; environment substitution producing an empty command; copy-paste that dropped the actual program path.

Related errors


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