Skip to content

pr-sous-chef: document GraphQL fetch for reviewThreads (fixes invalid gh pr view field) - #53833

Merged
pelikhan merged 2 commits into
mainfrom
copilot/fix-pr-processor-reviewthreads
Aug 19, 2026
Merged

pr-sous-chef: document GraphQL fetch for reviewThreads (fixes invalid gh pr view field)#53833
pelikhan merged 2 commits into
mainfrom
copilot/fix-pr-processor-reviewthreads

Conversation

Copilot AI commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

The pr-processor sub-agent prompt told the agent to read review-thread node IDs (PRRT_...) "from reviewThreads" without specifying a valid way to fetch it. In practice the agent guessed gh pr view --json ...,reviewThreads,..., which gh rejects (Unknown JSON field: "reviewThreads"), burning the sub-agent's tool-call budget on every scheduled run and falling through to skip/insufficient-context fallbacks instead of processing review threads.

  • Explicit data-fetch instructions: added a note to the pr-processor prompt stating gh pr view --json has no reviewThreads field, with the correct gh api graphql query to fetch thread node IDs, resolution state, and comments.
  • Non-thread metadata: documented the valid gh pr view --json number,comments,reviews,headRefName,headRefOid,mergeStateStatus,title call (without reviewThreads) for everything else.
  • Downstream clarity: updated the "resolve review threads" step to point back at the GraphQL-sourced data and explicitly warn against gh pr view --json reviewThreads.
  • Lock file: recompiled pr-sous-chef.md to regenerate pr-sous-chef.lock.yml.
gh api graphql -f query='query($owner:String!,$repo:String!,$pr:Int!){repository(owner:$owner,name:$repo){pullRequest(number:$pr){reviewThreads(first:100){nodes{id isResolved comments(first:10){nodes{author{login} body}}}}}}}' -f owner=github -f repo=gh-aw -F pr=<N>

… invalid gh pr view field

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix command for fetching review threads in pr-processor pr-sous-chef: document GraphQL fetch for reviewThreads (fixes invalid gh pr view field) Aug 18, 2026
Copilot AI requested a review from pelikhan August 18, 2026 22:00
@pelikhan
pelikhan marked this pull request as ready for review August 19, 2026 00:31
Copilot AI balanced review requested due to automatic review settings August 19, 2026 00:31
@pelikhan
pelikhan merged commit 310b4eb into main Aug 19, 2026
@pelikhan
pelikhan deleted the copilot/fix-pr-processor-reviewthreads branch August 19, 2026 00:31
@github-actions

Copy link
Copy Markdown
Contributor

PR Triage

  • Category: docs · Risk: low
  • Score: 28/100 (impact 8, urgency 5, quality 15)
  • Recommended action: defer

Tiny doc fix (8 lines) for internal pr-sous-chef process notes. Low priority.

Generated by 🔧 PR Triage Agent · auto · 58.5 AIC · ⌖ 2.15 AIC · ⊞ 8.3K ·

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Documents the correct GraphQL method for fetching PR review threads and avoids unsupported gh pr view fields.

Changes:

  • Adds explicit GraphQL review-thread instructions.
  • Documents valid non-thread PR metadata fields.
  • Regenerates the workflow lock metadata.
Show a summary per file
File Description
.github/workflows/pr-sous-chef.md Updates review-thread fetch guidance.
.github/workflows/pr-sous-chef.lock.yml Refreshes the generated body hash.

Review details

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Suppressed comments (1)

.github/workflows/pr-sous-chef.md:489

  • This prescribed data fetch omits a URL for each review comment, but the sub-agent is required at line 502 to include a direct link for every unresolved review thread. The compact candidate data also contains only the PR URL, so this query does not provide enough information to satisfy that output contract. Include the review comment url field in each comment node.
- To fetch PR review thread node IDs (`PRRT_...`), issue this GraphQL query instead: `gh api graphql -f query='query($owner:String!,$repo:String!,$pr:Int!){repository(owner:$owner,name:$repo){pullRequest(number:$pr){reviewThreads(first:100){nodes{id isResolved comments(first:10){nodes{author{login} body}}}}}}}' -f owner=github -f repo=gh-aw -F pr=<N>` — the resulting `reviewThreads` array (from `data.repository.pullRequest.reviewThreads.nodes`) is the only valid source of `PRRT_...` IDs; each node's `id` is the thread ID and `isResolved` indicates resolution state.
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Given one PR number and compact metadata for `github/gh-aw`. Query only `github/gh-aw`; never use review thread or review IDs from another repository.

- `gh pr view --json` has **no** `reviewThreads` field; requesting it fails with `Unknown JSON field: "reviewThreads"`. Never pass `reviewThreads` to `gh pr view --json`.
- To fetch PR review thread node IDs (`PRRT_...`), issue this GraphQL query instead: `gh api graphql -f query='query($owner:String!,$repo:String!,$pr:Int!){repository(owner:$owner,name:$repo){pullRequest(number:$pr){reviewThreads(first:100){nodes{id isResolved comments(first:10){nodes{author{login} body}}}}}}}' -f owner=github -f repo=gh-aw -F pr=<N>` — the resulting `reviewThreads` array (from `data.repository.pullRequest.reviewThreads.nodes`) is the only valid source of `PRRT_...` IDs; each node's `id` is the thread ID and `isResolved` indicates resolution state.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Fix the code for this review comment.

When a review comment includes a suggested change, apply the suggestion exactly.

Do not make changes beyond what is described in the linked review comment.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[safeoutputs] PR Sous Chef: pr-processor sub-agent uses invalid gh CLI field 'reviewThreads', causing repeated run failures

4 participants