Fix /find-mergeable-claude-prs check-rollup truncation#1434
Conversation
gh pr list --json statusCheckRollup truncates each PR's rollup, so any filter applied to it can falsely accept PRs whose pending/failing checks were dropped. Use the list call only to enumerate candidate claude/* PR numbers, then re-query each one with gh pr view to get the complete rollup before applying the all-green filter. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
LGTM — straightforward fix to a slash command file.
Extended reasoning...
Overview
The PR modifies a single Claude Code slash command markdown file (.claude/commands/find-mergeable-claude-prs.md). It restructures the all-green PR detection into two steps: first enumerate claude/* PR numbers via gh pr list, then re-query each one with gh pr view to obtain the full status check rollup. The motivation is a real observed bug where gh pr list --json statusCheckRollup truncates the rollup array and silently accepted PRs with queued/in-progress sweep jobs.
Security risks
None. This is a local Claude Code command definition (documentation/prompt). It contains shell snippets that the user runs in their own environment via gh. No new credentials, network surface, or privileged operations are introduced.
Level of scrutiny
Very low. This is a tooling/UX command file used only by Claude Code, not production code. The fix is mechanical, the rationale is clearly stated in the PR description, and the jq filter logic is preserved verbatim from the old single-query path — only the data source changes from a (truncated) bulk JSON to per-PR queries.
Other factors
The bug hunting system found no issues. The change is small, self-contained, and reversible. No CODEOWNERs are involved (this is under .claude/commands/). Test plan is documented.
Summary
gh pr list --json statusCheckRolluptruncates each PR's rollup array, so any per-check filter applied to its output can silently accept PRs whose pending or failing checks were dropped.claude/*PR numbers, then re-query each one withgh pr viewto get the complete rollup before applying the all-green filter.Test plan
/find-mergeable-claude-prsand confirm the listed set matches a manualgh pr view <n> --json statusCheckRollupaudit for each candidate.🤖 Generated with Claude Code