{"record":{"id":"1a99e9fe1c31eb18","repo":"nikivdev/code","slug":"enable-global-is-only-supported-for-codex-sessions","errorCode":null,"errorMessage":"enable-global is only supported for Codex sessions; use `f codex enable-global`","messagePattern":"enable-global is only supported for Codex sessions; use `f codex enable-global`","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/ai.rs","lineNumber":9642,"sourceCode":"        );\n    }\n    Ok(String::from_utf8_lossy(&output.stdout).trim().to_string())\n}\n\nfn codex_enable_global(\n    dry_run: bool,\n    install_launchd: bool,\n    start_daemon: bool,\n    sync_skills: bool,\n    full: bool,\n    minutes: usize,\n    limit: usize,\n    max_targets: usize,\n    within_hours: u64,\n    provider: Provider,\n) -> Result<()> {\n    if provider != Provider::Codex {\n        bail!(\"enable-global is only supported for Codex sessions; use `f codex enable-global`\");\n    }\n\n    let install_launchd = install_launchd || full;\n    let start_daemon = start_daemon || full;\n    let sync_skills = sync_skills || full;\n    let config_path = config::default_config_path();\n    let (rendered, created, skill_source_added, skill_source_available) =\n        upsert_global_codex_config(&config_path)?;\n\n    if dry_run {\n        println!(\"# codex enable-global\");\n        println!(\"config_path: {}\", config_path.display());\n        println!(\"config_created: {}\", created);\n        println!(\"skill_source_available: {}\", skill_source_available);\n        println!(\"skill_source_added: {}\", skill_source_added);\n        if install_launchd {\n            let preview = install_codex_skill_eval_launchd(\n                &env::current_exe().context(\"failed to resolve current flow executable\")?,","sourceCodeStart":9624,"sourceCodeEnd":9660,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/ai.rs#L9624-L9660","documentation":"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`.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Run the Codex-specific command instead: `f codex enable-global`.","Switch the active session/provider to Codex before retrying (e.g. start a Codex session or set the provider flag to codex).","If the wrong provider was auto-detected, correct the provider selection in your Flow config or the command-line flag."],"exampleFix":"// before\n$ f enable-global --provider claude\nError: enable-global is only supported for Codex sessions; use `f codex enable-global`\n\n// after\n$ f codex enable-global","handlingStrategy":"validation","validationCode":"let provider = detect_provider(); // or parse the --provider flag\nif provider != Provider::Codex {\n    eprintln!(\"enable-global is Codex-only; use `f codex enable-global`\");\n    std::process::exit(2);\n}","typeGuard":"fn is_codex(p: &Provider) -> bool {\n    matches!(p, Provider::Codex)\n}","tryCatchPattern":"if let Err(e) = flow_enable_global() {\n    if e.to_string().contains(\"only supported for Codex sessions\") {\n        // fall back to the Codex-specific subcommand or switch provider first\n    }\n}","preventionTips":["Use the `f codex <subcommand>` form directly for Codex-only features (enable-global, doctor, touch-launch).","Check the active session's provider before invoking provider-gated commands in scripts.","Avoid pinning a non-Codex default provider in config if you rely on these Codex-only commands."],"tags":["rust","codex","provider-mismatch","cli"],"backgroundTag":"provider-not-supported","analyzedSha":"a747e741ae92c09071d0ae946ab48488adcff1ce","analyzedAt":"2026-09-01T22:43:55.719Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}