[Bug]: PR detail and watch_pull_request fail when a fine-grained token can't read check runs (follow-up to #15229)#22966
Follow-up to #15229, as requested there ("please open a new issue for that part only").
What happens
With a fine-grained GitHub personal access token, opening a pull request's detail still fails, because the detail read asks for every check run and GitHub doesn't offer a Checks permission for fine-grained tokens. GET /repos/{owner}/{repo}/commits/{sha}/check-runs returns 403 "Resource not accessible by personal access token". The detail read treats that single refusal as a failure of the whole answer.
The most visible effect is watch_pull_request. Each sweep reads the PR detail, every read fails, and the watch stops after 8 failures ("failed to read it from the host 8 times", about 16 minutes), so a watched PR never wakes the thread. On one server here that was 58 such stops in a week against 3 real wakes. The PR detail panel and pull-request guides fail the same way.
What already works
Since #16320 and #19224, the list, pull-request page and merge-settlement reads ask only for the overall check state, so they work with Commit statuses: Read. With the same token, reviews, comments, mergeable state and the overall rollup state all read fine.
Expected
When check runs can't be read, the detail read should degrade instead of failing: return the rest of the PR with checks marked unavailable (or fall back to the overall rollup state, as the list does). A watch would then still wake on reviews, comments, conflicts and the overall check state.
Environment
- T3 Code 0.1.2-nightly.20261021.3457 (server, Linux), headless, GitHub auth through
ghwith a fine-grained PAT (Contents, Pull requests, Commit statuses, Actions read). - The same watches work with a classic token or a user login on another machine.