nikivdev/code · error

connect is only supported for Codex sessions; use `f codex c

Error message

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

What it means

run_provider(Provider::Cursor, ...) dispatches provider AI actions. Cursor sessions only support a subset of actions (list, latest-id, copy, context, show); the Connect action is Codex-only, so requesting `f cursor connect ...` bails with this message directing the user to `f codex connect ...`.

Source

Thrown at src/ai.rs:550

#[derive(Debug, Clone, PartialEq, Eq)]
struct PrFeedbackCursorHandoff {
    workspace_path: PathBuf,
    review_plan_path: PathBuf,
    review_rules_path: Option<PathBuf>,
    kit_system_path: PathBuf,
}

/// Run a provider-specific action (for top-level `f codex` / `f claude` commands).
pub fn run_provider(provider: Provider, action: Option<ProviderAiAction>) -> Result<()> {
    if provider == Provider::Cursor {
        match action {
            None | Some(ProviderAiAction::List) => list_sessions(Provider::Cursor)?,
            Some(ProviderAiAction::LatestId { path }) => {
                print_latest_session_id(Provider::Cursor, path)?
            }
            Some(ProviderAiAction::Connect { .. }) => {
                bail!("connect is only supported for Codex sessions; use `f codex connect ...`");
            }
            Some(ProviderAiAction::Copy { session }) => copy_session(session, Provider::Cursor)?,
            Some(ProviderAiAction::Context {
                session,
                count,
                path,
            }) => copy_context(session, Provider::Cursor, count, path)?,
            Some(ProviderAiAction::Show {
                session,
                path,
                count,
                full,
            }) => show_session(session, Provider::Cursor, count, path, full)?,
            Some(ProviderAiAction::Runtime { .. }) => {
                bail!(
                    "runtime helpers are only supported for Codex sessions; use `f codex runtime ...`"
                );
            }

View on GitHub (pinned to a747e741ae)

Solutions

  1. Re-run the command with the codex provider: `f codex connect ...`
  2. If you need connection features for Cursor sessions, check whether list/copy/context/show cover your need (`f cursor list`, `f cursor show`)
  3. Fix scripts/templates that substitute the provider name blindly into subcommand names

Example fix

// before
$ f cursor connect <session-id>
// error: connect is only supported for Codex sessions
// after
$ f codex connect <session-id>
Defensive patterns

Strategy: validation

Validate before calling

const CURSOR_UNSUPPORTED_ACTIONS: &[&str] =
    &["connect", "runtime", "doctor", "eval", "touch-launch", "enable-global", "daemon", "memory"];
fn cursor_supports(action: &str) -> bool {
    !CURSOR_UNSUPPORTED_ACTIONS.contains(&action)
}

Type guard

fn is_codex_provider(p: &Provider) -> bool { *p == Provider::Codex }

Try / catch

match run_provider(Provider::Cursor, Some(ProviderAiAction::Connect { .. })) {
    Err(e) if e.to_string().contains("only supported for Codex") => {
        eprintln!("re-run with: f codex connect ...");
    }
    r => r?,
}

Prevention

When it happens

Trigger: Invoking the CLI with a Cursor provider and a Connect action, e.g. `f cursor connect <session-id>` or `f cursor connect --workspace ...`.

Common situations: User habitually uses `f codex connect` and swaps in `cursor` assuming feature parity; scripts parameterized over provider name passing 'cursor' to commands only implemented for Codex; documentation/alias confusion between providers.

Related errors


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