{"record":{"id":"962713b82b3f082d","repo":"BigPizzaV3/CodexPlusPlus","slug":"packaged-app-activation-is-only-supported-on-windo","errorCode":null,"errorMessage":"Packaged app activation is only supported on Windows","messagePattern":"Packaged app activation is only supported on Windows","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/launcher.rs","lineNumber":3254,"sourceCode":"            }\n            _ => {\n                output.push_str(&\"\\\\\".repeat(backslashes));\n                output.push(ch);\n                backslashes = 0;\n            }\n        }\n    }\n    output.push_str(&\"\\\\\".repeat(backslashes * 2));\n    output.push('\"');\n    output\n}\n\n#[cfg(not(windows))]\npub async fn activate_packaged_app(\n    _app_user_model_id: &str,\n    _arguments: &str,\n) -> anyhow::Result<u32> {\n    anyhow::bail!(\"Packaged app activation is only supported on Windows\")\n}\n\n#[cfg(windows)]\npub async fn activate_packaged_app(\n    app_user_model_id: &str,\n    arguments: &str,\n) -> anyhow::Result<u32> {\n    let app_user_model_id = app_user_model_id.to_string();\n    let arguments = arguments.to_string();\n    tokio::task::spawn_blocking(move || {\n        activate_packaged_app_blocking(&app_user_model_id, &arguments)\n    })\n    .await\n    .context(\"packaged app activation task failed\")?\n}\n\n#[cfg(windows)]\nfn activate_packaged_app_blocking(app_user_model_id: &str, arguments: &str) -> anyhow::Result<u32> {","sourceCodeStart":3236,"sourceCodeEnd":3272,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/b1ed92e5e4a2d74095d4b8db5af43cef7acba9c6/crates/codex-plus-core/src/launcher.rs#L3236-L3272","documentation":"`activate_packaged_app` launches an app by AppUserModelId via Windows shell activation (IApplicationActivationManager). This Win32 COM mechanism does not exist on other OSes, so the non-Windows cfg stub refuses the call outright. The error states the platform restriction explicitly.","triggerScenarios":"Calling activate_packaged_app with an app_user_model_id on macOS/Linux, or a cross-platform flow (e.g. debug takeover or manager launch) that reaches the non-Windows stub.","commonSituations":"Trying to launch a Windows Store/packaged app (e.g. a packaged Codex UI) from a non-Windows dev machine; cross-platform code not branching on target_os before activation.","solutions":["Run the packaged-app activation flow only on Windows (guard callers with #[cfg(windows)] or a runtime OS check)","On non-Windows, launch the equivalent app via its normal executable/bundle path (e.g. `open` on macOS) instead of AUMID activation","Update UI/CLI to hide the activate-packaged-app action on non-Windows platforms"],"exampleFix":"// before\npub async fn activate_packaged_app(aumid: &str, args: &str) -> anyhow::Result<u32> { activate_packaged_app(aumid, args).await }\n// after\nif !cfg!(windows) {\n    anyhow::bail!(\"packaged app activation is Windows-only; launch the executable directly instead\");\n}","handlingStrategy":"fallback","validationCode":"if !cfg!(windows) {\n    // use platform-native launch instead\n    return launch_via_native_path(executable, args);\n}","typeGuard":"fn supports_packaged_app_activation() -> bool { cfg!(windows) }","tryCatchPattern":"match activate_packaged_app(aumid, args).await {\n    Ok(pid) => {},\n    Err(e) if e.to_string().contains(\"only supported on Windows\") => launch_via_native_path(fallback_exe, args)?,\n    Err(e) => return Err(e),\n}","preventionTips":["Hide packaged-app actions from non-Windows UI","Provide a non-packaged executable fallback for all platforms","Check OS at startup and configure launch strategy accordingly","Document that AUMID activation is Windows-only"],"tags":["rust","windows","uwp","app-activation","cross-platform"],"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"}