nikivdev/code · error

enable-global is only supported for Codex sessions; use `f c

Error message

enable-global is only supported for Codex sessions; use `f codex enable-global`

What it means

The enable-global flow (installing a launchd job, starting the daemon, syncing skills globally) is implemented only for Codex-backed sessions. When the resolved Provider is anything other than Provider::Codex, Flow rejects the command up front and points users at the Codex-specific subcommand `f codex enable-global`.

Source

Thrown at src/ai.rs:9642

        );
    }
    Ok(String::from_utf8_lossy(&output.stdout).trim().to_string())
}

fn codex_enable_global(
    dry_run: bool,
    install_launchd: bool,
    start_daemon: bool,
    sync_skills: bool,
    full: bool,
    minutes: usize,
    limit: usize,
    max_targets: usize,
    within_hours: u64,
    provider: Provider,
) -> Result<()> {
    if provider != Provider::Codex {
        bail!("enable-global is only supported for Codex sessions; use `f codex enable-global`");
    }

    let install_launchd = install_launchd || full;
    let start_daemon = start_daemon || full;
    let sync_skills = sync_skills || full;
    let config_path = config::default_config_path();
    let (rendered, created, skill_source_added, skill_source_available) =
        upsert_global_codex_config(&config_path)?;

    if dry_run {
        println!("# codex enable-global");
        println!("config_path: {}", config_path.display());
        println!("config_created: {}", created);
        println!("skill_source_available: {}", skill_source_available);
        println!("skill_source_added: {}", skill_source_added);
        if install_launchd {
            let preview = install_codex_skill_eval_launchd(
                &env::current_exe().context("failed to resolve current flow executable")?,

View on GitHub (pinned to a747e741ae)

Solutions

  1. Run the Codex-specific command instead: `f codex enable-global`.
  2. Switch the active session/provider to Codex before retrying (e.g. start a Codex session or set the provider flag to codex).
  3. If the wrong provider was auto-detected, correct the provider selection in your Flow config or the command-line flag.

Example fix

// before
$ f enable-global --provider claude
Error: enable-global is only supported for Codex sessions; use `f codex enable-global`

// after
$ f codex enable-global
Defensive patterns

Strategy: validation

Validate before calling

let provider = detect_provider(); // or parse the --provider flag
if provider != Provider::Codex {
    eprintln!("enable-global is Codex-only; use `f codex enable-global`");
    std::process::exit(2);
}

Type guard

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

Try / catch

if let Err(e) = flow_enable_global() {
    if e.to_string().contains("only supported for Codex sessions") {
        // fall back to the Codex-specific subcommand or switch provider first
    }
}

Prevention

When it happens

Trigger: Invoking the enable-global command path while the active provider is a non-Codex provider (e.g. Claude or another Provider enum variant), whether via provider auto-detection of the current session or an explicit provider flag.

Common situations: Running `f enable-global` from within a Claude session; passing `--provider claude` (or similar) to enable-global; a config file pinning a non-Codex default provider.

Related errors


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