{"record":{"id":"134233203c12fb44","repo":"Hmbown/CodeWhale","slug":"pr-input-exceeds-the-bounded-capture-limit-8-mib-diff-no","errorCode":null,"errorMessage":"PR input exceeds the bounded capture limit (8 MiB diff); no partial output was accepted","messagePattern":"PR input exceeds the bounded capture limit \\(8 MiB diff\\); no partial output was accepted","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/tools/review_pr.rs","lineNumber":504,"sourceCode":"        .context(\"PR command stderr unavailable\")?;\n    let stdout = std::thread::spawn(move || read_bounded(stdout, MAX_OUTPUT_BYTES));\n    let stderr = std::thread::spawn(move || read_bounded(stderr, 64 * 1024));\n    let status = match child.wait_timeout(Duration::from_secs(60))? {\n        Some(status) => status,\n        None => {\n            let _ = child.kill();\n            let _ = child.wait();\n            bail!(\"PR input command timed out; no partial output was accepted\");\n        }\n    };\n    let stdout = stdout\n        .join()\n        .map_err(|_| anyhow::anyhow!(\"PR stdout reader failed\"))??;\n    let stderr = stderr\n        .join()\n        .map_err(|_| anyhow::anyhow!(\"PR stderr reader failed\"))??;\n    if stdout.len() > MAX_OUTPUT_BYTES || stderr.len() > 64 * 1024 {\n        bail!(\n            \"PR input exceeds the bounded capture limit (8 MiB diff); no partial output was accepted\"\n        );\n    }\n    if !status.success() {\n        bail!(\n            \"PR input command failed: {}\",\n            String::from_utf8_lossy(&stderr).trim()\n        );\n    }\n    String::from_utf8(stdout).context(\"PR diff is not valid UTF-8; no lossy review is accepted\")\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n\n    fn view(files: usize) -> GhPullRequest {\n        GhPullRequest {","sourceCodeStart":486,"sourceCodeEnd":522,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/tools/review_pr.rs#L486-L522","documentation":"review_pr.rs runs PR-related git/gh commands via run_command, which captures stdout/stderr fully into memory. Before accepting the output it enforces hard caps (MAX_OUTPUT_BYTES ≈ 8 MiB for stdout, 64 KiB for stderr); if either is exceeded it bails with this message and discards the capture entirely — no truncated/partial output is ever used for review.","triggerScenarios":"Calling fetch_diff, fetch_view, context_blob, or git() (and the tests large_pr_uses_all_pinned_git_patches_and_exact_binary_ids_not_the_checkout / oversized_embedded_binary_baseline_fails_but_metadata_fallback_is_complete) when the PR's diff or view output exceeds 8 MiB, or its stderr exceeds 64 KiB.","commonSituations":"Reviewing a very large PR with thousands of changed files or huge generated/binary assets embedded in the diff; a misbehaving git helper that spews massive stderr (e.g. verbose warnings, LFS noise) past 64 KiB.","solutions":["Split the review: fetch the diff in smaller chunks (e.g. per-file or per-path diffs) instead of one whole-PR diff","Reduce diff size: use pinned git patches or binary blob IDs instead of an embedded baseline (the tool's own large-PR strategy), or exclude binary/generated files from the diff","Check stderr noise: run the underlying git/gh command manually and silence or redirect the verbose stderr that exceeds 64 KiB","If you own the tool: raise MAX_OUTPUT_BYTES or implement chunked/streaming capture"],"exampleFix":"// before\ngit([\"diff\", \"HEAD..origin/pr\"])?\n// after\n// limit the diff surface so the capture stays under 8 MiB\ngit([\"diff\", \"HEAD..origin/pr\", \"--\", \"src/\"])?","handlingStrategy":"validation","validationCode":"if stdout.len() > 8 * 1024 * 1024 || stderr.len() > 64 * 1024 { /* chunk the diff before invoking */ }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Chunk large PR diffs per-file or per-directory instead of one whole diff","Exclude binary/generated files from review diffs","Keep git helper stderr quiet; redirect noise away from captured stderr","Know the limits: 8 MiB stdout, 64 KiB stderr"],"tags":["git","subprocess","output-limit","pr-review"],"backgroundTag":"payload-too-large","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}