fix: stop dropping a review thread's fifty-first comment - #66
Merged
Conversation
hasNextPage alone can arrive with an empty endCursor; sending that as after= risks GitHub rejecting the request and PRReviewContext returning no review comments at all. Match the two page loops already in this file, wrap the fetch's error with the step it failed at, and assert the follow-up walk carries the cursor forward past the first extra page. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Both handoffs describe work that still needs a real terminal to confirm. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Code Metrics Report
Code coverage of files in pull request scope (93.5%, patch 86.6%)
Reported by octocov |
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.
Phase 3 の 3 本目、最後。実装計画は
docs/superpowers/plans/2026-09-08-phase3-comment-paging.md。塞いだ穴
1 本のレビュースレッドに 51 件目以降のコメントが付いていると、エラーも出ずに黙って落ちていた。
review.graphqlのcomments(first: 50)を追う手段が無かったため。commentsは nested connection なので、reviewThreadsの cursor では追えない。50 件を超えたと自分で言っているスレッドだけ、
node(id:)でそのスレッドを名指しして残りを引く(
thread_comments.graphql)。超えていないスレッドには 1 リクエストも足さない。ページ数の上限は置かない(
reviewThreadsが上限なしに全ページ取るのと同じ流儀)。internal/tuiは 1 行も触っていない。画面の形は変わらず、今まで消えていた行が出るようになる。実物で 1 度確認した
thread_comments.graphqlは録ったスキーマとしか突き合わせていなかったので、実際に叩いた。PR #59 のスレッド(
PRRT_kwDOTVXF-M6fwhR-)でdata.node.comments.nodesが返ることを確認した。全体レビューで見つけて直したもの
繰り越すつもりだった 2 件が、見積もりより悪かったので撤回して直した。
hasNextPage: trueでendCursorが空の応答に対して空カーソルのリクエストを投げる。GitHub がそれを無効なカーソルとして断ると
PRReviewContext全体が error になり、diff のレビュー欄が丸ごと消える。「無駄な 1 往復」で済む話ではなかった
cursor = page.PageInfo.EndCursorを落としてもテストは通るが、実物では同じページを問い続ける上限の無い無限ループになる。
ページ数に上限を置かないと決めている以上、これが一番悪い失敗の形
ほかに、追加取得のエラーが包まれていなかった件(隣の
parse thread comments:と非対称)も直した。触らなかったもの
comments(first: 50)のまま。この 1 ページは全スレッド分まとめて返ってくるので、上げると「長いスレッドが 1 本ある PR」ではなく全部の PR の応答が重くなる
work.graphql、search のfirst: 50、labelsのfirst: 100。spec §5 が「別の機会にする」と書いているもの
Phase 3 完了
checks(#62)、merge(#65)、ページング(この PR)で 3 本すべて。
docs/superpowers/2026-09-08-phase3-checks-followups.mdを締めた。残っているのは設計判断 1 つだけ: GitHub App が作った check run が、直上のワークフローの
一員に見える問題。「再実行できる run が無い」ことを示す印を spec で決める必要がある。
実端末での確認は 2 つの handoff 文書に残っている(checks / merge)。
🤖 Generated with Claude Code