Skip to content

fix(pr-review): pass diff_map via temp file, not argv - #33

Open
clawgenti wants to merge 1 commit into
rossoctl:mainfrom
clawgenti:fm/fix-diff-map-argmax
Open

clawgenti wants to merge 1 commit into
rossoctl:mainfrom
clawgenti:fm/fix-diff-map-argmax

Conversation

@clawgenti

Copy link
Copy Markdown
Collaborator

Problem

pr-review-fixer.sh begin builds the enriched queue entry with:

jq -n --argjson diff_map "$DIFF_MAP" ...

The kernel caps a single argument at 128 KiB (MAX_ARG_STRLEN), so any PR whose parsed diff map exceeds that crashes begin with:

line 162: jq: Argument list too long

PRs with ~300 KiB diffs (e.g. rossoctl/moca#856, rossoctl/cortex#1934) hit this deterministically, killing the whole fixer run — including the PRs before them in the queue already marked in_progress in the temp state. The follow-up append (--argjson entry "$enriched") has the same exposure.

Fix

Write the diff map and the built entry to temp files and read them with --slurpfile instead — the same file-based pattern the state write already uses ("avoids argument-length limits", see pr_review_state_write).

Verification

  • tests/test-vendor-engine.sh passes.
  • Dry-run begin against the live queue now processes all 5 eligible PRs, including a 5802-line / 119-file diff map, where it previously died mid-queue with the error above.

🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant