Hmbown/CodeWhale · error · anyhow::Error
Failed to run `gh pr diff
Error message
Failed to run `gh pr diff`: {e} What it means
Spawning the `gh pr diff` subprocess failed at the OS level before any output was produced; not a gh-reported failure (those surface as 'gh pr diff #N failed').
Solutions
- Verify `gh` is installed and executable
- Check system process/resource limits
- Retry after correcting the environment
Defensive patterns
Strategy: retry
When it happens
Trigger: Thrown at crates/tui/src/lib.rs:8280 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of Hmbown/CodeWhale@0c42157ee5 (2026-08-20).
Data as JSON: /api/errors/acffedb0e13e773f.
Report an issue: GitHub.
Appendix: source
Thrown at crates/tui/src/lib.rs:8280
Ok(GhPullRequest {
title: pick("title"),
body: pick("body"),
base: pick("baseRefName"),
head: pick("headRefName"),
url: pick("url"),
})
}
fn run_gh_pr_diff(number: u32, repo: Option<&str>) -> Result<String> {
let mut cmd = crate::dependencies::Gh::command()
.ok_or_else(|| anyhow::anyhow!("gh not found on PATH"))?;
cmd.arg("pr").arg("diff").arg(number.to_string());
if let Some(r) = repo {
cmd.arg("--repo").arg(r);
}
let output = cmd
.output()
.map_err(|e| anyhow::anyhow!("Failed to run `gh pr diff`: {e}"))?;
if !output.status.success() {
let stderr = String::from_utf8_lossy(&output.stderr).trim().to_string();
bail!("gh pr diff #{number} failed: {stderr}");
}
Ok(String::from_utf8_lossy(&output.stdout).to_string())
}
fn run_gh_pr_checkout(number: u32, repo: Option<&str>) -> Result<()> {
let mut cmd = crate::dependencies::Gh::command()
.ok_or_else(|| anyhow::anyhow!("gh not found on PATH"))?;
cmd.arg("pr").arg("checkout").arg(number.to_string());
if let Some(r) = repo {
cmd.arg("--repo").arg(r);
}
let output = cmd
.output()
.map_err(|e| anyhow::anyhow!("Failed to run `gh pr checkout`: {e}"))?;
if !output.status.success() {View on GitHub (pinned to 0c42157ee5)