Skip to content

Codex plugin marketplace upgrade times out while cloning marketplace source #24815

Open

Description

When upgrading an already installed marketplace backed by a private GitHub repository, the command fails because the git clone step exceeds the 30s timeout.

Command

codex plugin marketplace upgrade example-private-marketplace

Error

Failed to upgrade marketplace `example-private-marketplace`: git clone marketplace source timed out after 30s: Cloning into '/Users/<user>/.codex/.tmp/marketplaces/.staging/marketplace-upgrade-XXXXXX'...

Expected

The upgrade should complete successfully, or the clone timeout should be longer/configurable for marketplace sources.

Actual

The upgrade fails after 30 seconds during the git clone step.

Environment

  • Codex CLI: 0.134.0
  • OS: macOS
  • Marketplace source: private GitHub repository

Activity

  1. added
    bug
    on May 29, 2026
  2. denniswon commented on Nov 2, 2026

    @denniswon

    The runner itself can also produce this error. It pipes git's stdout and stderr but reads neither until git exits (or is killed at the timeout):

    fn run_git_command_with_timeout(
    command: &mut Command,
    context: &str,
    timeout: Duration,
    ) -> Result<Output, String> {
    let mut child = command
    .stdin(Stdio::null())
    .stdout(Stdio::piped())
    .stderr(Stdio::piped())
    .spawn()
    .map_err(|err| format!("failed to run {context}: {err}"))?;
    let start = std::time::Instant::now();
    loop {
    match child.try_wait() {
    Ok(Some(_)) => {
    return child
    .wait_with_output()
    .map_err(|err| format!("failed to wait for {context}: {err}"));
    }
    Ok(None) => {}
    Err(err) => return Err(format!("failed to poll {context}: {err}")),
    }
    if start.elapsed() >= timeout {
    let _ = child.kill();
    let output = child
    .wait_with_output()
    .map_err(|err| format!("failed to wait for {context} after timeout: {err}"))?;
    let stderr = String::from_utf8_lossy(&output.stderr).trim().to_string();
    return if stderr.is_empty() {
    Err(format!("{context} timed out after {}s", timeout.as_secs()))
    } else {
    Err(format!(
    "{context} timed out after {}s: {stderr}",
    timeout.as_secs()
    ))
    };
    }
    std::thread::sleep(Duration::from_millis(100));
    }
    }

    The curated plugins sync has a copy with the same problem (startup_sync.rs#L683-L735). Once git writes more than the pipe holds, it blocks in write(), never exits, and the timeout kills it. I hit this on 0.166.0, and the runner is unchanged on main.

    Without a terminal git writes very little here: the "Cloning into" line, plus "Updating files" checkout progress once a checkout runs longer than 2s. That is a few KB at most, well under a normal pipe, but macOS drops new pipes to a minimal buffer once system pipe memory runs short. On one of my Macs the codex bundled with ChatGPT.app was holding about 4,400 pipe ends and running about 1,100 node and node_repl children (possibly related to #37672), and new pipes held only 512 bytes. Five of the 20 git timeouts in logs_2.sqlite had 487-499 bytes of "Updating files" progress as the captured stderr, just under that pipe size, so git was waiting on Codex rather than on the network.

    The captured stderr also tells the two cases apart. In the report above it's just the "Cloning into" line, so that pipe wasn't full, and that one is probably a slow clone hitting the fixed 30s limit (#38770).

    What fixed it for me: read both pipes on threads while polling, and spawn git in its own process group so the timeout kill also reaches git-remote-https and index-pack. Those inherit the pipes, so killing only git can leave the readers waiting on them. I can share the patch, with tests for 1 MiB of stderr and for a helper that keeps the pipe open after git is killed.

  3. added
    CLI
    skills
    connectivity
    on Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIbugconnectivityskills

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions