Hmbown/CodeWhale · error

PR input command timed out; no partial output was accepted

Error message

PR input command timed out; no partial output was accepted

What it means

run_command spawns a PR-input subprocess (gh or git), reading stdout/stderr on bounded reader threads and waiting with a 60-second timeout via wait_timeout. If the child does not exit in time it is killed and the tool bails with this message — partial output is never used, since a truncated diff or view would silently corrupt the review's integrity checks.

Solutions

  1. Check gh auth non-interactively: `gh auth status` and `GH_TOKEN`/`GITHUB_TOKEN` set, so gh never blocks on a login prompt
  2. Disable credential prompts: `GIT_TERMINAL_PROMPT=0 GCM_INTERACTIVE=never` and configure a cache/credential helper, then rerun
  3. Test the exact command manually (`gh pr view <n> --json ...`) to see whether it is network slowness; retry or use a faster mirror/token with higher rate limits

Example fix

// before: gh blocks on interactive auth in CI
run: gh pr view 123 --json id
// after: token exported, prompts off, timeout honored
run: |
  export GH_TOKEN=${{ github.token }}
  export GIT_TERMINAL_PROMPT=0
  gh pr view 123 --json id
Defensive patterns

Strategy: try-catch

Validate before calling

// preflight that gh/git run quickly and non-interactively
assert!(std::env::var_os("GH_TOKEN").is_some() || auth_status_ok(), "export GH_TOKEN to avoid interactive gh auth");
std::env::set_var("GIT_TERMINAL_PROMPT", "0");

Try / catch

match fetch_view(number, repo) {
    Err(e) if e.to_string().contains("timed out") => {
        eprintln!("gh/git hung >60s; check auth prompts, network, and rerun with GIT_TERMINAL_PROMPT=0");
        retry_with_backoff(|| fetch_view(number, repo), 2)?;
    }
    other => other?,
}

Prevention

When it happens

Trigger: `gh pr view`, `gh pr diff`, or the git invocations routed through run_command (fetch_view, fetch_diff, context_blob, git helpers) block longer than 60 seconds — e.g. gh hanging on network I/O or a credential prompt.

Common situations: gh waiting for interactive auth (expired token, no GH_TOKEN, browser prompt in a headless CI); slow/unreachable GitHub Enterprise endpoint; git credential-manager prompting on stdin; very large diffs on a slow disk; DNS hang in sandboxes.

Understand the failure class

Background: Request timed out: what client-side request timeouts mean across libraries (Request timed out, TIMED_OUT, APITimeoutError) — this error's family across 39 libraries.

Related errors


AI-assisted analysis of Hmbown/CodeWhale@73e0f67d83 (2026-09-22). Data as JSON: /api/errors/517235022407377e. Report an issue: GitHub.

Appendix: source

Thrown at crates/tui/src/tools/review_pr.rs:494

    let mut child = command
        .spawn()
        .context("Failed to start PR input command")?;
    let stdout = child
        .stdout
        .take()
        .context("PR command stdout unavailable")?;
    let stderr = child
        .stderr
        .take()
        .context("PR command stderr unavailable")?;
    let stdout = std::thread::spawn(move || read_bounded(stdout, MAX_OUTPUT_BYTES));
    let stderr = std::thread::spawn(move || read_bounded(stderr, 64 * 1024));
    let status = match child.wait_timeout(Duration::from_secs(60))? {
        Some(status) => status,
        None => {
            let _ = child.kill();
            let _ = child.wait();
            bail!("PR input command timed out; no partial output was accepted");
        }
    };
    let stdout = stdout
        .join()
        .map_err(|_| anyhow::anyhow!("PR stdout reader failed"))??;
    let stderr = stderr
        .join()
        .map_err(|_| anyhow::anyhow!("PR stderr reader failed"))??;
    if stdout.len() > MAX_OUTPUT_BYTES || stderr.len() > 64 * 1024 {
        bail!(
            "PR input exceeds the bounded capture limit (8 MiB diff); no partial output was accepted"
        );
    }
    if !status.success() {
        bail!(
            "PR input command failed: {}",
            String::from_utf8_lossy(&stderr).trim()
        );

View on GitHub (pinned to 73e0f67d83)