BigPizzaV3/CodexPlusPlus · error · anyhow::Error

invalid bundled marketplace path

Error message

invalid bundled marketplace path

What it means

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.

Source

Thrown at crates/codex-plus-core/src/computer_use_guard.rs:474

#[cfg(windows)]
pub(crate) fn ensure_openai_bundled_marketplace(home: &Path) -> anyhow::Result<Option<PathBuf>> {
    let active = home
        .join(".tmp")
        .join("bundled-marketplaces")
        .join(BUNDLED_MARKETPLACE);
    if is_complete_openai_bundled_marketplace(&active) {
        return Ok(Some(active));
    }
    if let Some(configured) = configured_openai_bundled_marketplace(home) {
        if is_complete_openai_bundled_marketplace(&configured) {
            return Ok(Some(configured));
        }
    }

    let parent = active
        .parent()
        .ok_or_else(|| anyhow::anyhow!("invalid bundled marketplace path"))?;
    std::fs::create_dir_all(parent)?;

    let staging = parent.join(format!(
        "{BUNDLED_MARKETPLACE}.guard-staging-{}",
        std::time::SystemTime::now()
            .duration_since(std::time::UNIX_EPOCH)
            .unwrap_or_default()
            .as_millis()
    ));
    if staging.exists() {
        std::fs::remove_dir_all(&staging)?;
    }

    if let Some(source) = find_complete_openai_bundled_marketplace(parent, &active) {
        copy_dir_recursive(&source, &staging)?;
    } else if can_build_marketplace_from_cache(home) {
        build_marketplace_from_cache(home, &staging)?;
    } else {

View on GitHub (pinned to 1f431ae49b)

Solutions

  1. 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
  2. Report as a bug with the logged path if it reproduces on a stock install
Defensive patterns

Strategy: validation

Validate before calling

// Verify the marketplace location is a real nested path before staging
let active = state_dir.join(BUNDLED_MARKETPLACE);
ensure!(active.parent().is_some_and(|p| p.try_exists().unwrap_or(false)),
    "marketplace base directory missing: {}", active.display());

Type guard

fn path_has_parent(p: &std::path::Path) -> bool { p.parent().is_some() }

Prevention

When it happens

Trigger: 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.

Common situations: Not reachable through normal configuration; would require a corrupted state/install-dir resolution feeding an empty base directory into the join.

Related errors


AI-assisted analysis of BigPizzaV3/CodexPlusPlus@1f431ae49b (2026-08-16). Data as JSON: /api/errors/d28e5e36072850de. Report an issue: GitHub.