{"record":{"id":"d28e5e36072850de","repo":"BigPizzaV3/CodexPlusPlus","slug":"invalid-bundled-marketplace-path","errorCode":null,"errorMessage":"invalid bundled marketplace path","messagePattern":"invalid bundled marketplace path","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/computer_use_guard.rs","lineNumber":474,"sourceCode":"\n#[cfg(windows)]\npub(crate) fn ensure_openai_bundled_marketplace(home: &Path) -> anyhow::Result<Option<PathBuf>> {\n    let active = home\n        .join(\".tmp\")\n        .join(\"bundled-marketplaces\")\n        .join(BUNDLED_MARKETPLACE);\n    if is_complete_openai_bundled_marketplace(&active) {\n        return Ok(Some(active));\n    }\n    if let Some(configured) = configured_openai_bundled_marketplace(home) {\n        if is_complete_openai_bundled_marketplace(&configured) {\n            return Ok(Some(configured));\n        }\n    }\n\n    let parent = active\n        .parent()\n        .ok_or_else(|| anyhow::anyhow!(\"invalid bundled marketplace path\"))?;\n    std::fs::create_dir_all(parent)?;\n\n    let staging = parent.join(format!(\n        \"{BUNDLED_MARKETPLACE}.guard-staging-{}\",\n        std::time::SystemTime::now()\n            .duration_since(std::time::UNIX_EPOCH)\n            .unwrap_or_default()\n            .as_millis()\n    ));\n    if staging.exists() {\n        std::fs::remove_dir_all(&staging)?;\n    }\n\n    if let Some(source) = find_complete_openai_bundled_marketplace(parent, &active) {\n        copy_dir_recursive(&source, &staging)?;\n    } else if can_build_marketplace_from_cache(home) {\n        build_marketplace_from_cache(home, &staging)?;\n    } else {","sourceCodeStart":456,"sourceCodeEnd":492,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/1f431ae49b57b3055e0e6845ba6156c6b4232b4d/crates/codex-plus-core/src/computer_use_guard.rs#L456-L492","documentation":"When the active openai-bundled marketplace file is incomplete and must be restaged (crates/codex-plus-core/src/computer_use_guard.rs:474), the guard creates its parent directory via active.parent(). Path::parent() returns None only for '' or '/', so 'invalid bundled marketplace path' is a defensive invariant — the active path is built by joining BUNDLED_MARKETPLACE onto a directory, which always yields a parent.","triggerScenarios":"The staged-marketplace code path runs with an 'active' path that is empty or the filesystem root — only possible if the marketplace location resolution upstream produced a degenerate value.","commonSituations":"Not reachable through normal configuration; would require a corrupted state/install-dir resolution feeding an empty base directory into the join.","solutions":["Log the computed 'active' marketplace path when the guard runs — it will be '' or '/','Fix the upstream directory resolution that produced the empty base path","Report as a bug with the logged path if it reproduces on a stock install"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Verify the marketplace location is a real nested path before staging\nlet active = state_dir.join(BUNDLED_MARKETPLACE);\nensure!(active.parent().is_some_and(|p| p.try_exists().unwrap_or(false)),\n    \"marketplace base directory missing: {}\", active.display());","typeGuard":"fn path_has_parent(p: &std::path::Path) -> bool { p.parent().is_some() }","tryCatchPattern":null,"preventionTips":["Validate the state/install base directory exists before computing derived paths","Treat root or empty base paths as configuration errors at detection time","Add tests that the marketplace path is always at least two components deep"],"tags":["defensive-invariant","path-validation","marketplace","computer-use-guard"],"backgroundTag":"path-without-parent-directory","analyzedSha":"1f431ae49b57b3055e0e6845ba6156c6b4232b4d","analyzedAt":"2026-08-16T20:54:18.598Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}