BigPizzaV3/CodexPlusPlus · error

Native browser compatibility is Windows-only

Error message

Native browser compatibility is Windows-only

What it means

BrowserPaths::current in crates/codex-plus-core/src/native_browser.rs guards the native browser feature, whose layout (LOCALAPPDATA-based runtime/state roots, reparse-point handling) is implemented only for Windows. On any other platform it fails fast with this error instead of producing broken paths.

Solutions

  1. Run the native browser feature on Windows only; gate the feature/profile behind cfg!(windows) in your own code
  2. Use a non-native (driver/CDP-based) browser integration on non-Windows platforms
  3. On Windows, ensure LOCALAPPDATA is set — it is required immediately after this check
  4. Skip the browser step conditionally: match BrowserPaths::current() Err and degrade gracefully

Example fix

// before
let paths = BrowserPaths::current()?;
// after
#[cfg(windows)]
let paths = BrowserPaths::current()?;
#[cfg(not(windows))]
let paths = fallback_browser_paths()?; // non-native implementation
Defensive patterns

Strategy: fallback

Validate before calling

#[cfg(not(windows))]
let native_browser_enabled = false;
#[cfg(windows)]
let native_browser_enabled = true;

Type guard

fn native_browser_supported() -> bool { cfg!(windows) }

Try / catch

match BrowserPaths::current() {
    Err(e) if e.to_string().contains("Windows-only") => {
        // switch to non-native browser integration
    }
    other => other?,
}

Prevention

When it happens

Trigger: Calling BrowserPaths::current() (public) on macOS or Linux, or in tests/binaries compiled with cfg!(windows) false; any code path that touches native-browser preparation, discovery, or restore on a non-Windows host.

Common situations: Developers running the manager or sync tooling on Linux/macOS while a profile enables the native browser; CI running on Linux runners; cross-platform scripts that unconditionally call the browser APIs.

Understand the failure class

Background: "unsupported platform" / "not supported on this platform" errors: what they mean and how to fix them — this error's family across 47 libraries.

Related errors


AI-assisted analysis of BigPizzaV3/CodexPlusPlus@b1ed92e5e4 (2026-09-19). Data as JSON: /api/errors/be2521dcffe574f9. Report an issue: GitHub.

Appendix: source

Thrown at crates/codex-plus-core/src/native_browser.rs:61

                (
                    "bin/node_modules/@oai/cua-repl/bin/cua-repl.mjs",
                    "992174a5e637645aeb444adfdb1bae688e997bb84d7db07532f68e358e60f278".into(),
                ),
            ],
        }
    }
}

#[derive(Debug, Clone)]
pub struct BrowserPaths {
    pub codex_home: PathBuf,
    pub runtime_root: PathBuf,
    pub state_root: PathBuf,
}

impl BrowserPaths {
    pub fn current() -> Result<Self> {
        ensure!(
            cfg!(windows),
            "Native browser compatibility is Windows-only"
        );
        let local = std::env::var_os("LOCALAPPDATA").context("LOCALAPPDATA is unavailable")?;
        Ok(Self {
            codex_home: crate::codex_home::default_codex_home_dir(),
            runtime_root: PathBuf::from(local).join("OpenAI/Codex/runtimes/cua_node"),
            state_root: crate::paths::default_app_state_dir().join("native-browser-identification"),
        })
    }
}

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct BrowserStatus {
    pub state: String,
    pub detail: String,
}

View on GitHub (pinned to b1ed92e5e4)