nikivdev/code · error

resolve is only supported for Codex sessions; use `f codex r

Error message

resolve is only supported for Codex sessions; use `f codex resolve ...`

What it means

This Rust CLI (Flow) supports resolving/looking up sessions for multiple AI providers, but the `resolve` subcommand's underlying session-open logic is implemented only for Codex sessions. When the command is invoked with any other provider selected, the function bails out early with a message pointing the user at the provider-scoped `f codex resolve ...` command.

Source

Thrown at src/ai.rs:7933

        return Ok(());
    }

    bail!(
        "failed to connect to codex session {} for {}",
        row.id,
        launch_path.display()
    )
}

fn resolve_codex_input(
    path: Option<String>,
    query: Vec<String>,
    exact_cwd: bool,
    json_output: bool,
    provider: Provider,
) -> Result<()> {
    if provider != Provider::Codex {
        bail!("resolve is only supported for Codex sessions; use `f codex resolve ...`");
    }

    let (query, json_output) = normalize_codex_resolve_args(query, json_output);
    let plan = build_codex_open_plan(path, query, exact_cwd)?;
    record_codex_open_plan(&plan, "resolve");
    if json_output {
        println!(
            "{}",
            serde_json::to_string_pretty(&plan).context("failed to encode Codex resolve JSON")?
        );
        return Ok(());
    }

    print_codex_open_plan(&plan);
    Ok(())
}

pub fn codex_resolve_inspector(

View on GitHub (pinned to a747e741ae)

Solutions

  1. Re-run the command scoped to Codex: `f codex resolve ...`
  2. Switch the active provider to Codex before invoking resolve (e.g. pass the provider flag or update the default provider in the Flow config)
  3. If resolve for another provider is genuinely needed, use that provider's own lookup commands or file a feature request

Example fix

// before
f resolve "fix login bug"
// after
f codex resolve "fix login bug"
Defensive patterns

Strategy: validation

Validate before calling

// Rust: check provider before calling resolve
if provider != Provider::Codex {
    eprintln!("resolve requires Codex; run `f codex resolve ...` instead");
    return Ok(());
}
let result = resolve_session(path, query, exact_cwd, json_output, provider);

Type guard

fn is_codex(provider: &Provider) -> bool { *provider == Provider::Codex }

Try / catch

match resolve_session(&path, query, exact_cwd, json_output, provider) {
    Ok(()) => (),
    Err(e) if e.to_string().contains("only supported for Codex") => {
        eprintln!("Hint: use `f codex resolve ...`");
    }
    Err(e) => return Err(e),
}

Prevention

When it happens

Trigger: Calling the generic `resolve` command (e.g. `f resolve <query>`) while the active provider is anything other than Provider::Codex (e.g. provider set to Claude or another backend via flag or config).

Common situations: Users with a default non-Codex provider in their Flow config running `f resolve` expecting Codex session lookup; scripts that call `f ai resolve` generically after switching providers; muscle memory from Codex-only versions of the tool.

Related errors


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