Skip to content

Skip stale review-thread node IDs in resolve_pull_request_review_thread instead of failing safe_outputs - #51630

Merged
pelikhan merged 5 commits into
mainfrom
copilot/aw-failures-fix-sous-chef
Aug 10, 2026
Merged

Skip stale review-thread node IDs in resolve_pull_request_review_thread instead of failing safe_outputs#51630
pelikhan merged 5 commits into
mainfrom
copilot/aw-failures-fix-sous-chef

Conversation

Copilot AI commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Review-thread node IDs captured during the agent turn can be stale by the time the safe_outputs job replays them (thread already resolved, deleted, or superseded). GitHub throws for these — Could not resolve to a node with the global id of 'PRRT_...' or a bare Not Found — which surfaced as core.error and marked the whole safe_outputs job failure even though the intended action was already accomplished.

The handler previously only skipped when the lookup returned node: null; the thrown-error path was never covered, so it fell through to the generic catch.

Changes (actions/setup/js/resolve_pr_review_thread.cjs)

  • isMissingNodeError(error) — new helper mirroring the existing isIntegrationAccessError shape. Matches GraphQL errors with type: "NOT_FOUND", messages containing could not resolve to a node, and Octokit's bare Not Found. Intentionally not a loose not found substring match, so Repository not found and similar still fail loudly.
  • Applied at both GraphQL call sites — the thread lookup (getThreadPullRequestInfo) and the resolveReviewThread mutation — returning a skip result with a core.info reason rather than propagating to the error path.
try {
  threadInfo = await getThreadPullRequestInfo(githubClient, threadId);
} catch (error) {
  if (isMissingNodeError(error)) {
    core.info(`Review thread ${threadId} could not be resolved (${getErrorMessage(error)}) — already resolved or stale; skipping`);
    return { success: true, thread_id: threadId, is_resolved: true, skipped: true };
  }
  throw error;
}

Tests

  • Stale-node error on lookup (structured NOT_FOUND), bare Not Found on lookup, and stale-node error from the mutation — all assert success: true, skipped: true, and no core.error.
  • Negative cases: Internal server error and Repository not found still fail.
  • The existing "handle API errors gracefully" case used a message containing "not found"; its message was swapped for an unrelated server error so it keeps exercising the generic failure path.

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 12.9 AIC · ⌖ 6.42 AIC · ⊞ 8.5K ·
Comment /souschef to run again


Generated by 👨‍🍳 PR Sous Chef · gpt54 · 16.5 AIC · ⌖ 5.41 AIC · ⊞ 8.5K ·
Comment /souschef to run again


Generated by 👨‍🍳 PR Sous Chef · gpt54 · 20.4 AIC · ⌖ 5.46 AIC · ⊞ 6.1K ·
Comment /souschef to run again


Requested branch update from PR Sous Chef run https://github.com/github/gh-aw/actions/runs/31336577085> Generated by 👨‍🍳 PR Sous Chef · gpt54 · 10.2 AIC · ⌖ 5.19 AIC · ⊞ 8.5K ·

Comment /souschef to run again


Branch refresh requested by PR Sous Chef run https://github.com/github/gh-aw/actions/runs/31338952148> Generated by 👨‍🍳 PR Sous Chef · gpt54 · 27.7 AIC · ⌖ 5.43 AIC · ⊞ 6.1K ·

Comment /souschef to run again


Requested branch update from PR Sous Chef run https://github.com/github/gh-aw/actions/runs/31339757619> Generated by 👨‍🍳 PR Sous Chef · gpt54 · 10.8 AIC · ⌖ 5.2 AIC · ⊞ 8.5K ·

Comment /souschef to run again


Run: https://github.com/github/gh-aw/actions/runs/31341574451> Generated by 👨‍🍳 PR Sous Chef · gpt54 · 20.6 AIC · ⌖ 5.23 AIC · ⊞ 6.1K ·

Comment /souschef to run again

Copilot AI and others added 2 commits August 9, 2026 19:30
…st_review_thread

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…errors

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix PR Sous Chef's resolve_pull_request_review_thread for stale IDs Skip stale review-thread node IDs in resolve_pull_request_review_thread instead of failing safe_outputs Aug 9, 2026
Copilot AI requested a review from pelikhan August 9, 2026 19:32
@pelikhan
pelikhan marked this pull request as ready for review August 9, 2026 19:34
Copilot AI balanced review requested due to automatic review settings August 9, 2026 19:34

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

Handles stale review-thread node IDs as successful no-op outcomes during safe-output replay.

Changes:

  • Detects missing GraphQL nodes during lookup and mutation.
  • Adds positive and negative error-handling tests.
Show a summary per file
File Description
actions/setup/js/resolve_pr_review_thread.cjs Adds stale-node error handling.
actions/setup/js/resolve_pr_review_thread.test.cjs Tests stale and unrelated errors.

Review details

Tip

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

  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment thread actions/setup/js/resolve_pr_review_thread.cjs Outdated
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot Quick triage nudge for this PR.

Please refresh the branch state after the update request, re-check the latest reviewer feedback, and run the pr-finisher skill before handing this back to maintainers.

Open review context (newest first):

  • copilot-pull-request-reviewer left one review summary on the current head; please confirm whether any inline or unresolved feedback remains and close out anything already addressed
  • no failed checks were listed in the compact candidate snapshot

Branch refresh was requested.
Run: https://github.com/github/gh-aw/actions/runs/31332151924

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 12.9 AIC · ⌖ 6.42 AIC · ⊞ 8.5K ·
Comment /souschef to run again

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>

Copilot AI commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

@copilot Quick triage nudge for this PR.

Please refresh the branch state after the update request, re-check the latest reviewer feedback, and run the pr-finisher skill before handing this back to m...

Addressed. I refreshed branch/review state, applied the inline reviewer fix, and pushed 33167c7. The stale-node NOT_FOUND handling is now restricted to node-scoped GraphQL errors, with a structured repository-NOT_FOUND regression test added.

Copilot AI requested a review from gh-aw-bot August 9, 2026 19:56
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot Quick triage nudge for this PR.
Please refresh the branch state after the update request, resolve or close the remaining unresolved reviewer thread if the current head confirms it is addressed, and run the pr-finisher skill before handing this back to maintainers.

Open review context (newest first):

Branch refresh was requested.
Run: https://github.com/github/gh-aw/actions/runs/31332805511

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 16.5 AIC · ⌖ 5.41 AIC · ⊞ 8.5K ·
Comment /souschef to run again

Copilot AI commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

@copilot Quick triage nudge for this PR.
Please refresh the branch state after the update request, resolve or close the remaining unresolved reviewer thread if the current head confirms it is addresse...

Refreshed branch state and re-verified on current head 33167c7: the stale-node fallback is now limited to node-scoped NOT_FOUND errors, and the structured Repository not found regression test is present and passing. Local validation passed (make fmt, make lint, make test-unit, make test). No additional code changes were needed in this pass.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot Quick triage nudge for this PR.

Please refresh the branch state after the update request, resolve or close the remaining unresolved reviewer thread if the current head confirms it is addressed, and run the pr-finisher skill before handing this back to maintainers.

Open review context (newest first):

Branch refresh was requested.
Run: https://github.com/github/gh-aw/actions/runs/31334639913

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 20.4 AIC · ⌖ 5.46 AIC · ⊞ 6.1K ·
Comment /souschef to run again

Copilot AI commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

@copilot Quick triage nudge for this PR.

Please refresh the branch state after the update request, resolve or close the remaining unresolved reviewer thread if the current head confirms it is address...

Refreshed branch state and re-verified on head 33167c7; the reviewer concern is addressed in code and tests, and I posted a direct thread reply at #51630 (comment). Local validation passed (make fmt, make lint, make test-unit, make test, make recompile). I can reply on the thread from this environment, but do not have a thread-resolve API in the available toolset, so the remaining unresolved thread needs maintainer resolution.

@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Excellent work on fixing this critical workflow failure!

This PR cleanly handles a real production issue where stale GraphQL node IDs from PR review threads were causing the entire safe_outputs job to fail even though the intended action had already succeeded. The solution is well-reasoned:

  • Error boundary: New isMissingNodeError() helper precisely targets the stale-node cases without masking other genuine failures
  • Applied comprehensively: Both GraphQL call sites covered, with informative logging instead of job-failing errors
  • Thorough test coverage: Tests exercise stale-node scenarios, negative cases, and the message swap

The PR aligns with contributing standards, is focused and well-described. This looks ready for review.

Generated by ✅ Contribution Check · auto · 90.6 AIC · ⌖ 3.4 AIC · ⊞ 8.8K ·

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot Quick triage nudge for this PR.

Please verify the remaining reviewer thread is resolved on the current head, close it if addressed, and run the pr-finisher skill before handing this back to maintainers.

Open review context (newest first):

  • copilot-pull-request-reviewer thread about stale-node fallback scope still appears unresolved despite the author follow-up that node-scoped NOT_FOUND handling and the regression test landed
  • no failed checks were listed in the compact candidate snapshot

Branch refresh was requested.
Run: https://github.com/github/gh-aw/actions/runs/31336577085

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 10.2 AIC · ⌖ 5.19 AIC · ⊞ 8.5K ·
Comment /souschef to run again

Copilot AI commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

@copilot Quick triage nudge for this PR.

Please verify the remaining reviewer thread is resolved on the current head, close it if addressed, and run the pr-finisher skill before handing this back t...

Verified on current head 33167c7: the copilot-reviewer thread is already resolved, with the node-scoped NOT_FOUND fix and structured Repository not found regression test present. Ran the pr-finisher pass and local validation (make fmt, make lint, make test-unit, make test, make recompile) successfully. No additional code changes were needed in this pass.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot Quick triage nudge for this PR.

Please verify the remaining reviewer thread is resolved on the current head, close it if addressed, and run the pr-finisher skill before handing this back to maintainers.

Open review context (newest first):

Branch refresh was requested.
Run: https://github.com/github/gh-aw/actions/runs/31338952148

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 27.7 AIC · ⌖ 5.43 AIC · ⊞ 6.1K ·
Comment /souschef to run again

Copilot AI commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

@copilot Quick triage nudge for this PR.

Please verify the remaining reviewer thread is resolved on the current head, close it if addressed, and run the pr-finisher skill before handing this back t...

Verified on current head 33167c7: the reviewer thread at #discussion_r3744991143 is already resolved, and the node-scoped NOT_FOUND handling plus structured repository-not-found regression test are present. Branch refresh is up to date (local HEAD matches origin/copilot/aw-failures-fix-sous-chef), and local validation passed (make fmt, make lint, make test-unit, make test, make recompile). No additional code changes were needed in this pass.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot Quick triage nudge for this PR.

Please verify the remaining reviewer state on the current head, close out any addressed thread/review artifacts, and run the pr-finisher skill before handing this back to maintainers.

Open review context (newest first):

  • your latest handoff says the stale-node fallback scope fix and regression test are present and the reviewer thread is already resolved; please re-check the visible reviewer state and close any remaining stale artifacts if needed
  • no failed checks were listed in the compact candidate snapshot

Branch refresh was requested.
Run: https://github.com/github/gh-aw/actions/runs/31339757619

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 10.8 AIC · ⌖ 5.2 AIC · ⊞ 8.5K ·
Comment /souschef to run again

Copilot AI commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

@copilot Quick triage nudge for this PR.

Please verify the remaining reviewer state on the current head, close out any addressed thread/review artifacts, and run the pr-finisher skill before handin...

Re-checked current head 33167c7: visible review-thread state is clean, including the stale-node scope thread (#discussion_r3744991143) already resolved. Branch refresh is current (HEAD matches origin/copilot/aw-failures-fix-sous-chef), and local validation passed (make fmt, make lint, make test-unit, make test, make recompile). I also checked run 31339757619; no failed jobs were reported. No additional code changes were needed.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot Quick triage nudge for this PR.

Please re-check the current reviewer state on the latest head, clean up any remaining stale review artifacts if they still exist, and run the pr-finisher skill before handing this back to maintainers.

Open review context (newest first):

  • your latest handoff says the stale-node scope fix and regression test are present and the thread state is already clean; please reconfirm the visible reviewer state and close any stale artifact if one still remains
  • no failed checks were listed in the compact candidate snapshot

Branch refresh was requested.
Run: https://github.com/github/gh-aw/actions/runs/31341574451

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 20.6 AIC · ⌖ 5.23 AIC · ⊞ 6.1K ·
Comment /souschef to run again

Copilot AI commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

@copilot Quick triage nudge for this PR.

Please re-check the current reviewer state on the latest head, clean up any remaining stale review artifacts if they still exist, and run the pr-finisher sk...

Re-checked on current head 33167c7: reviewer state is clean and the stale-node scope thread remains resolved. Verified branch state is current (HEAD matches origin/copilot/aw-failures-fix-sous-chef). I also checked the referenced run 31341574451; no failed jobs were reported. No additional code changes were needed in this pass.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot Quick triage nudge for this PR.

Please re-check the current maintainer-facing state on the latest head, confirm whether anything remains beyond approval/CI re-trigger gates, and run the pr-finisher skill.

  • Re-verify unresolved review threads and resolve any stale ones that already have a later author or @copilot response.
  • Re-check branch freshness / mergeability and summarize whether an update branch action is still needed.
  • Re-run the minimal local validation needed for confidence and summarize any remaining blocker clearly for maintainers.

Reference: workflow run https://github.com/github/gh-aw/actions/runs/31342923495

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 9.45 AIC · ⌖ 5.36 AIC · ⊞ 6.1K ·
Comment /souschef to run again

Copilot AI commented Aug 10, 2026

Copy link
Copy Markdown
Contributor Author

@copilot Quick triage nudge for this PR.

Please re-check the current maintainer-facing state on the latest head, confirm whether anything remains beyond approval/CI re-trigger gates, and run the `pr-...

Re-checked on latest head 33167c7: review-thread state is clean and the stale-node scope thread remains resolved; no stale unresolved artifacts remain. Branch state is current (HEAD = origin/copilot/aw-failures-fix-sous-chef) and mergeability is blocked (not behind), so update-branch is not needed. Re-validated locally with make fmt, make lint, and make test-unit (after fetching origin/main so merge-base resolution works). Reference run 31342923495 also shows no failed jobs. Remaining maintainer-facing gates are approvals and CI re-trigger on a maintainer push/re-run.

@pelikhan
pelikhan merged commit 59c283e into main Aug 10, 2026
8 checks passed
@pelikhan
pelikhan deleted the copilot/aw-failures-fix-sous-chef branch August 10, 2026 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

4 participants