Skip to content

[aw-failures] resolve_pull_request_review_thread returns 403 "Resource not accessible by integration" on self-created threads — [Content truncated due to length] #33137

@github-actions

Description

@github-actions

Problem statement

The resolve_pull_request_review_thread safe-output handler fails with GitHub GraphQL error Resource not accessible by integration even when the workflow holds pull-requests: write and the thread was created by the same GITHUB_TOKEN earlier in the run. This breaks the Smoke Claude end-to-end coverage of the handler.

Affected workflows and runs

  • Smoke Claude — run §26047160386 (pull_request on copilot/agent-step-probes-runtime, PR Prevent safe-output PR probing from creating stray downstream pull requests #33044, 2026-05-18 16:44 UTC, 10m31s, conclusion: failure, attempt 2).
    • The smoke prompt exercises every safe-output handler in one payload (12 messages). 11/12 succeed; message 5 (resolve_pull_request_review_thread) fails.
    • This is reproducible — the same job failed at least twice (run_attempt: 2), suggesting a deterministic permission issue, not a transient API hiccup.
  • Any workflow that creates a review comment and then tries to resolve its own thread in the same run is exposed (Smoke Claude is the only such caller in the current tree, but resolve_pull_request_review_thread is a public safe-output handler that other workflows could adopt).

Evidence

safe_outputs job log (truncated)
Processing message 1/12: create_pull_request_review_comment
✓ Message 1 (create_pull_request_review_comment) completed successfully
...
Processing message 5/12: resolve_pull_request_review_thread
Resolving review thread: PRRT_kwDOPc1QR86C3hJx (PR #33044 in github/gh-aw)
##[error]Failed to resolve review thread: Request failed due to following response errors:
 - Resource not accessible by integration
##[error]✗ Message 5 (resolve_pull_request_review_thread) failed: ...
safe_outputs job permissions block (smoke-claude.lock.yml:2958)
permissions:
  contents: read
  discussions: write
  issues: write
  pull-requests: write
  security-events: write

The handler is invoked with pull-requests: write, so the failure is not a missing permissions declaration in the workflow — it is GitHub rejecting the resolveReviewThread mutation for the bot identity itself.

Probable root cause

The GraphQL mutation in actions/setup/js/resolve_pr_review_thread.cjs:62-78:

mutation ($threadId: ID!) {
  resolveReviewThread(input: { threadId: $threadId }) {
    thread { id isResolved }
  }
}

is executed with the workflow's GITHUB_TOKEN. GitHub requires the actor to be the comment author, a repo maintainer, or a PR collaborator to resolve a thread via GraphQL — pull-requests: write on a bot token is not sufficient for resolveReviewThread when the thread was authored by the same bot in a non-interactive context. This is the documented behaviour for the integration token.

Review comments earlier in the same run do succeed because create_pull_request_review_comment only requires pull-requests: write; resolveReviewThread has stricter actor-identity requirements.

Proposed remediation

Pick one of the following — they are listed in increasing order of disruption:

  1. Handler-level graceful degradation (recommended). In actions/setup/js/resolve_pr_review_thread.cjs, detect the Resource not accessible by integration GraphQL response and downgrade to a logged warning instead of a job-level failure. Equivalent to the core.warning fallback already used by submit_pull_request_review in the same run (see message 12 in the same log: PR review submission failed due to unresolvable comment line(s) ... Retrying as body-only review.).
  2. Smoke-test isolation. In .github/workflows/smoke-claude.md (and the parallel smoke-codex.md), gate the resolve_pull_request_review_thread smoke step behind an explicit opt-in env so that runs against bot-authored threads stop reporting a hard failure when the underlying API limitation is known.
  3. Token swap. Document that callers needing reliable thread resolution must provide a PAT with elevated scope via secrets.GH_AW_RESOLVE_THREAD_TOKEN (or similar) and have the handler prefer it when present. Heavier — only do this if (1) and (2) are ruled out.

Success criteria / verification

  • Smoke Claude (and Smoke Codex, which has the same handler exposure) completes with safe_outputs.conclusion = success on the next scheduled run.
  • The handler's test file resolve_pr_review_thread.test.cjs gains coverage for the Resource not accessible by integration GraphQL error path, asserting the chosen degradation (warning vs. soft-skip) is produced.
  • If option (1) is taken: a hard failure is preserved for unexpected GraphQL errors so we don't silently swallow regressions; only the documented permission-denied response is downgraded.

Parent / cross-references

Generated by 🔍 [aw] Failure Investigator (6h) · ● 16.6M ·

  • expires on May 25, 2026, 7:28 PM UTC

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions