nikivdev/code · error

continue requires a specific provider (claude or codex)

Error message

continue requires a specific provider (claude or codex)

What it means

The continue/resume entry point in src/ai.rs:5447 bails when provider is Provider::All because continuing a session requires knowing which provider CLI to launch. Like the sessions check, generic provider selection is rejected with guidance to pick claude or codex.

Source

Thrown at src/ai.rs:5447

    }

    resume_session(
        Some(selected_id.to_string()),
        Some(target.display().to_string()),
        Provider::Codex,
    )
}

fn continue_session(
    session: Option<String>,
    path: Option<String>,
    provider: Provider,
) -> Result<()> {
    if session.is_some() {
        return resume_session(session, path, provider);
    }
    if provider == Provider::All {
        bail!("continue requires a specific provider (claude or codex)");
    }
    ensure_provider_tty(provider, "continue")?;

    if path
        .as_deref()
        .map(str::trim)
        .filter(|value| !value.is_empty())
        .is_some()
    {
        let target = resolve_session_target_path(path.as_deref())?;
        let sessions = read_sessions_for_target(provider, path.as_deref())?;
        let sess = sessions.first().ok_or_else(|| {
            anyhow::anyhow!(
                "No {} sessions found for {}",
                provider_name(provider),
                target.display()
            )
        })?;

View on GitHub (pinned to a747e741ae)

Solutions

  1. Specify the provider: `f ai claude continue` or `f ai codex continue`
  2. If resuming a known session, pass the session id so resume_session handles it
  3. Fix wrapper scripts to default provider to claude or codex, never all

Example fix

// before
$ f ai continue
// after
$ f ai claude continue
Defensive patterns

Strategy: validation

Validate before calling

if provider == "all" && session_id.is_none() {
    eprintln!("continue requires a provider: `f ai claude continue` or `f ai codex continue`");
    std::process::exit(2);
}

Type guard

fn continue_target_valid(p: Provider, session: Option<&str>) -> bool {
    session.is_some() || matches!(p, Provider::Claude | Provider::Codex)
}

Try / catch

match continue_session(provider, session, path) {
    Err(e) if e.to_string().contains("continue requires a specific provider") => {
        eprintln!("{e}");
    }
    other => other?,
}

Prevention

When it happens

Trigger: Calling continue without a specific provider (e.g. `f ai continue`) and without a --session argument; if a session id was passed the code resumes it instead, otherwise Provider::All hits this bail before ensure_provider_tty.

Common situations: Omitting the provider token in the command; scripts or aliases that default the provider to All; new users following outdated docs where continue inferred the provider.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


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