nikivdev/code · error

runtime helpers are only supported for Codex sessions; use `

Error message

runtime helpers are only supported for Codex sessions; use `f codex runtime ...`

What it means

The Runtime helper action is implemented only for Codex sessions. When run_provider is called with Provider::Cursor and a Runtime action, it bails with this message pointing the user at `f codex runtime ...`.

Source

Thrown at src/ai.rs:565

                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 ...`"
                );
            }
            Some(ProviderAiAction::Doctor { .. }) => {
                bail!("doctor is only supported for Codex sessions; use `f codex doctor`");
            }
            Some(ProviderAiAction::Eval { .. }) => {
                bail!("eval is only supported for Codex sessions; use `f codex eval`");
            }
            Some(ProviderAiAction::TouchLaunch { .. }) => {
                bail!(
                    "touch-launch is only supported for Codex sessions; use `f codex touch-launch`"
                );
            }
            Some(ProviderAiAction::EnableGlobal { .. }) => {
                bail!(
                    "global Codex enablement is only supported for Codex sessions; use `f codex enable-global`"
                );

View on GitHub (pinned to a747e741ae)

Solutions

  1. Use `f codex runtime ...` instead
  2. For Cursor sessions, limit to supported actions: list, latest-id, copy, context, show
  3. Add provider capability checks to scripts before invoking runtime subcommands

Example fix

// before
$ f cursor runtime status
// error: runtime helpers are only supported for Codex sessions
// after
$ f codex runtime status
Defensive patterns

Strategy: validation

Validate before calling

fn assert_codex_for_runtime(provider: &Provider) -> Result<()> {
    if *provider != Provider::Codex {
        bail!("runtime helpers require the codex provider");
    }
    Ok(())
}

Type guard

fn supports_runtime(p: &Provider) -> bool { matches!(p, Provider::Codex) }

Try / catch

if let Err(e) = run_provider(Provider::Cursor, Some(ProviderAiAction::Runtime { .. })) {
    if e.to_string().contains("runtime helpers are only supported") {
        eprintln!("use: f codex runtime ...");
    }
}

Prevention

When it happens

Trigger: Running `f cursor runtime ...` with any runtime subcommand (runtime helpers operate on Codex runtime state).

Common situations: User assumes runtime introspection works for all providers; muscle-memory command substitution from codex to cursor; automation enumerating actions per provider without a capability whitelist.

Related errors


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