fix(review): raise checkout inspection ls-files buffer for large repos - #1196
Conversation
runAgentCheckoutInspection lists tracked files with git ls-files --stage -z using the 1 MB spawnSync default. openclaw/openclaw's listing is over 3 MB, so every read-only checkout inspection failed with ENOBUFS (output buffer overflow) and no review could complete.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: found issues before merge. Reviewed August 17, 2026, 8:56 AM ET / 12:56 UTC. ClawSweeper reviewWhat this changesThis PR raises the Git tracked-file listing buffer used during checkout inspection and adds a regression test for an index listing exceeding Node’s default buffer. Regression provenancePossible regression — probable (reproduction; reviewed change). No predecessor PR is attributed. Merge readinessKeep open for normal maintainer review: current main still has the 1 MiB default on this pre-review path, while this focused patch raises the bound, adds regression coverage, and supplies credible after-fix real-review evidence. One non-blocking OpenClaw Bay-impact statement remains due under repository policy. Priority: P1 Review scores
Verification
How this fits togetherCheckout inspection validates a target repository’s tracked files before ClawSweeper starts an agent review. A successful inspection permits Codex or OpenClaw review to proceed; a failure stops review publication and records a retryable infrastructure error. flowchart LR
A[Target checkout] --> B[Git tracked-file listing]
B --> C[Checkout inspection]
C --> D{Challenge available?}
D -->|Yes| E[Agent review starts]
D -->|No or command error| F[Retryable review failure]
Before merge
Findings
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the bounded 64 MiB limit and regression test, add a brief statement that OpenClaw Bay is unaffected by this local admission-path change, then land after the current review and checks remain valid. Do we have a high-confidence way to reproduce the issue? Yes. The PR body supplies a concrete current-main command and ENOBUFS result against a large OpenClaw checkout, plus a controlled oversized-index regression scenario. Is this the best way to solve the issue? Yes. Raising only this listing command’s bound to the repository-standard 64 MiB value fixes the documented failure without weakening the fail-closed inspection behavior. Full review comments:
Overall correctness: patch is correct AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 866506fb0f57. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
Problem
Since #1170,
runAgentCheckoutInspectionlists tracked files withgit ls-files --stage -zunder the 1 MBspawnSyncdefaultmaxBuffer. openclaw/openclaw's stage listing is >3 MB, so every local review of an openclaw PR fails before Codex runs:Observed on
pnpm run review -- --local-only --target-repo openclaw/openclaw --item-number 125278at clawsweeper866506fb0f.Fix
src/agent-runner.ts:maxBuffer: 64 MiBon the listing spawn, with a comment naming the measurement.pr-behavior-proof
ls-files --stage -zoutput exceeds 1 MBrunAgentCheckoutInspectiontest/agent-runner.test.ts— index-only repo with 6000 × 220-byte paths (>1 MB listing), OpenClaw runnerspawnSync git ENOBUFS; post-fix build → proceeds to challenge selection (could not select a tracked text line, the expected outcome for an index-only fixture)node --test test/agent-runner.test.ts→ 8/8 pass post-fix, 7/8 pre-fix (new test fails with ENOBUFS)mainyet; local review of openclaw #125278 with this build follows and will be linked here.Live proof with this build
Local review of openclaw/openclaw#125278 (head
14ddf72f) with this branch built at0617d19e: checkout inspection passed and Codex completed (decision=keep_open confidence=high,overallCorrectness: patch is correct, 0 findings, security cleared). Same command onmain(866506fb0f) failed withRead-only checkout inspection failed ... ENOBUFSin ~1s.OpenClaw Bay impact
None. This changes only the local pre-review checkout inspection command's output buffer; no publication, queue, status/telemetry, or dashboard data contract changes, so Bay needs no update.