Skip to content
Source
Sign inSign up
pingdotgg/t3code

[Bug]: watch_pull_request silently stops waking on all comments and rereads every 2 minutes when review-thread reads fail #47963

Openaw338WoWmUI(GitHub profile, opens in a new tab) opened this issue 0 comments

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

  1. Configure T3 Code with a GitHub credential for which GitHubPullRequestApi.listReviewThreadComments (ReviewThreads) fails with a non-rate-limit error while getPullRequestDetail (PullRequestCore) and getPullRequestActivity (PullRequestActivity) succeed — for example, a token with repo and write:discussion but without read:org (the scope trigger itself is addressed separately by #40740), or any persistent GraphQL / HTTP 5xx error on listReviewThreadComments.
  2. Start watching an open pull request via watch_pull_request.
  3. While CI checks are still pending (or after checks finish), post a new top-level PR comment, submit a PR review, or add an inline review comment from another account.
  4. Observe the watched thread across multiple 2-minute watch sweeps (and inspect server logs and pull_request_read output).

Expected behavior

  • A failed listReviewThreadComments call should be logged (at least as a warning) rather than swallowed silently.
  • Persistent review-thread read failures should not cause a watched PR to silently suppress all comment/review wakes indefinitely with no visible error or notice to the watching thread.
  • When reviewThreadsTruncated persists across sweeps (whether from a persistent read error or a PR exceeding the 10-page review-thread cap), the watch reactor should not bypass unchanged fingerprints and force full detail + activity re-reads on every 2-minute sweep indefinitely.

Actual behavior

  1. Silent error swallowing: GitHubPullRequestProvider.getChangeRequestActivity (packages/source-control-github/src/server/GitHubPullRequestProvider.ts) catches every non-rate-limit error from cli.listReviewThreadComments with Effect.catchIf and returns a synthetic empty fallback with truncated: true and reviewThreadsTruncated: true, without logging the failure. Because activityRead returns Exit.Success, PullRequestWatchReactor never hits its pull request watch activity read failed warning path either.
  2. Total silent blackout on all comments and reviews: PullRequestWatchReactor.readRemarks (apps/server/src/orchestration-v2/PullRequestWatchReactor.ts) returns null whenever activity.commentsTruncated && activity.reviewThreadsTruncated !== false. Even when getPullRequestActivity succeeded and returned new top-level issue comments and reviews, all remarks are discarded silently (remarks = null), so the thread only ever wakes on check transitions and never on comments or reviews.
  3. Unbounded 2-minute full rereads (quota burn): Because readRemarks returns null, lastReads records remarksComplete: false. On every subsequent 2-minute sweep, planRead sees !last.remarksComplete and forces both detail: true and activity: true regardless of unchanged fingerprints (defeating FINGERPRINT_REREAD_MS).

Note: #40740 fixes the INSUFFICIENT_SCOPES trigger on Reactions / Team, which is how this was discovered, but this underlying silent-failure and reread-loop behavior affects any non-rate-limit listReviewThreadComments failure (or any PR whose review threads exceed the REVIEW_THREAD_PAGES cap) even after #40740 lands.

Impact

Major degradation or frequent failure

Version or commit

T3 Code 0.1.13 (main @ 5f982be5)

Environment

macOS, T3 Code 0.1.13 (desktop/server), GitHub provider

Logs or stack traces

# Direct GraphQL execution of ReviewThreads with a token lacking read:org
# produces INSUFFICIENT_SCOPES, which GitHubPullRequestProvider.getChangeRequestActivity
# catches silently and turns into:
#   commentsTruncated: true
#   reviewThreadsTruncated: true
#   reviewThreads: []
#
# No warning is logged in GitHubPullRequestProvider or PullRequestWatchReactor,
# readRemarks returns null on every sweep, and remarksComplete remains false.

Workaround

  • For the read:org scope trigger specifically, granting read:org to the token (or landing #40740) restores listReviewThreadComments.
  • There is currently no workaround for the silent failure / unbounded reread behavior when listReviewThreadComments fails for other non-rate-limit reasons or hits the review-thread page cap.
  1. tanstack-source added labelsbug

Sign in to join this conversation.