{"record":{"id":"be2521dcffe574f9","repo":"BigPizzaV3/CodexPlusPlus","slug":"native-browser-compatibility-is-windows-only","errorCode":null,"errorMessage":"Native browser compatibility is Windows-only","messagePattern":"Native browser compatibility is Windows-only","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/native_browser.rs","lineNumber":61,"sourceCode":"                (\n                    \"bin/node_modules/@oai/cua-repl/bin/cua-repl.mjs\",\n                    \"992174a5e637645aeb444adfdb1bae688e997bb84d7db07532f68e358e60f278\".into(),\n                ),\n            ],\n        }\n    }\n}\n\n#[derive(Debug, Clone)]\npub struct BrowserPaths {\n    pub codex_home: PathBuf,\n    pub runtime_root: PathBuf,\n    pub state_root: PathBuf,\n}\n\nimpl BrowserPaths {\n    pub fn current() -> Result<Self> {\n        ensure!(\n            cfg!(windows),\n            \"Native browser compatibility is Windows-only\"\n        );\n        let local = std::env::var_os(\"LOCALAPPDATA\").context(\"LOCALAPPDATA is unavailable\")?;\n        Ok(Self {\n            codex_home: crate::codex_home::default_codex_home_dir(),\n            runtime_root: PathBuf::from(local).join(\"OpenAI/Codex/runtimes/cua_node\"),\n            state_root: crate::paths::default_app_state_dir().join(\"native-browser-identification\"),\n        })\n    }\n}\n\n#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]\n#[serde(rename_all = \"camelCase\")]\npub struct BrowserStatus {\n    pub state: String,\n    pub detail: String,\n}","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/b1ed92e5e4a2d74095d4b8db5af43cef7acba9c6/crates/codex-plus-core/src/native_browser.rs#L43-L79","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Run the native browser feature on Windows only; gate the feature/profile behind cfg!(windows) in your own code","Use a non-native (driver/CDP-based) browser integration on non-Windows platforms","On Windows, ensure LOCALAPPDATA is set — it is required immediately after this check","Skip the browser step conditionally: match BrowserPaths::current() Err and degrade gracefully"],"exampleFix":"// before\nlet paths = BrowserPaths::current()?;\n// after\n#[cfg(windows)]\nlet paths = BrowserPaths::current()?;\n#[cfg(not(windows))]\nlet paths = fallback_browser_paths()?; // non-native implementation","handlingStrategy":"fallback","validationCode":"#[cfg(not(windows))]\nlet native_browser_enabled = false;\n#[cfg(windows)]\nlet native_browser_enabled = true;","typeGuard":"fn native_browser_supported() -> bool { cfg!(windows) }","tryCatchPattern":"match BrowserPaths::current() {\n    Err(e) if e.to_string().contains(\"Windows-only\") => {\n        // switch to non-native browser integration\n    }\n    other => other?,\n}","preventionTips":["Gate native-browser features behind cfg!(windows) or a runtime OS check","Document platform requirements wherever the profile/feature is configured","On Linux/macOS CI, skip native browser tests instead of calling the API"],"tags":["rust","platform","windows"],"backgroundTag":"unsupported-platform","analyzedSha":"b1ed92e5e4a2d74095d4b8db5af43cef7acba9c6","analyzedAt":"2026-09-19T23:35:21.129Z","contentChangedAt":"2026-09-19T23:35:21.129Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}