pr-sous-chef: document GraphQL fetch for reviewThreads (fixes invalid gh pr view field) - #53833
Merged
Merged
Conversation
… 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
pelikhan
marked this pull request as ready for review
August 19, 2026 00:31
Contributor
PR Triage
Tiny doc fix (8 lines) for internal pr-sous-chef process notes. Low priority.
|
Contributor
There was a problem hiding this comment.
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
urlfield 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. |
There was a problem hiding this comment.
@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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
pr-processorsub-agent prompt told the agent to read review-thread node IDs (PRRT_...) "fromreviewThreads" without specifying a valid way to fetch it. In practice the agent guessedgh pr view --json ...,reviewThreads,..., whichghrejects (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.pr-processorprompt statinggh pr view --jsonhas noreviewThreadsfield, with the correctgh api graphqlquery to fetch thread node IDs, resolution state, and comments.gh pr view --json number,comments,reviews,headRefName,headRefOid,mergeStateStatus,titlecall (withoutreviewThreads) for everything else.gh pr view --json reviewThreads.pr-sous-chef.mdto regeneratepr-sous-chef.lock.yml.