Problem
cr respond can post inline summary replies through a GitHub App, but empirical testing on PR #359 showed the app installation token can fail resolveReviewThread with a GraphQL permission error even when it can post replies and the human viewer can resolve the same thread.
That means the PR itself can contain the durable summary reply, but the GitHub review thread may remain unresolved. Today the resolved-thread context path keys primarily off the provider isResolved flag, so a fresh review can miss the summary-as-cache signal and may reprocess or re-raise already-addressed discussion.
Desired behavior
Use CR-authored summary reply metadata as durable PR-local context, even when the provider cannot mark the thread resolved:
- Recognize
codereview:thread-summary marker replies authored by the posting identity.
- Treat the latest CR-authored thread-summary reply as settled context when no newer human reply follows it.
- Feed that summary into reviewer/dossier context so agents avoid recomputing or re-raising the discussion.
- If a newer human reply appears after the summary marker, consider the thread pending again.
- Preserve the provider
isResolved distinction so UI state and API resolution are not conflated with CR's own durable summary cache.
Empirical context
On PR #359:
- Human replied inline to CR-authored findings.
cr respond --dry-run --rerun correctly planned summary replies and thread resolution.
- Live
cr respond --rerun posted the summary replies as rianjs-bot.
resolveReviewThread failed for the GitHub App token with permission denied.
- A direct human
gh api graphql call to resolveReviewThread succeeded for the same thread IDs.
Proposed contract
A thread is provider-resolved when isResolved=true.
A thread is CR-settled when the latest CR-authored lifecycle comment carries a valid codereview:thread-summary marker and no later human comment exists.
Reviewer prompts should receive compact file-scoped summaries for both provider-resolved and CR-settled threads, while command output/diagnostics should make clear whether provider resolution actually happened.
Guardrails
- Run this through the GPT-5.5 xhigh consulting architect before implementation.
- Keep provider resolution and CR-settled metadata as separate domain concepts.
- Do not use top-level comments as substitutes for inline thread summaries.
- Unit tests should cover:
- unresolved thread with latest CR summary marker becomes CR-settled context
- newer human reply after summary marker reopens/pends the thread
- forged human-authored summary markers are ignored
- provider-resolved threads continue to use the existing latest-comment summary behavior
- reviewer/dossier context includes CR-settled summaries without reprocessing the full conversation
- Empirical test should use an open PR with an inline human reply and a GitHub App posting identity that can reply but cannot resolve.
Problem
cr respondcan post inline summary replies through a GitHub App, but empirical testing on PR #359 showed the app installation token can failresolveReviewThreadwith a GraphQL permission error even when it can post replies and the human viewer can resolve the same thread.That means the PR itself can contain the durable summary reply, but the GitHub review thread may remain unresolved. Today the resolved-thread context path keys primarily off the provider
isResolvedflag, so a fresh review can miss the summary-as-cache signal and may reprocess or re-raise already-addressed discussion.Desired behavior
Use CR-authored summary reply metadata as durable PR-local context, even when the provider cannot mark the thread resolved:
codereview:thread-summarymarker replies authored by the posting identity.isResolveddistinction so UI state and API resolution are not conflated with CR's own durable summary cache.Empirical context
On PR #359:
cr respond --dry-run --reruncorrectly planned summary replies and thread resolution.cr respond --rerunposted the summary replies asrianjs-bot.resolveReviewThreadfailed for the GitHub App token with permission denied.gh api graphqlcall toresolveReviewThreadsucceeded for the same thread IDs.Proposed contract
A thread is provider-resolved when
isResolved=true.A thread is CR-settled when the latest CR-authored lifecycle comment carries a valid
codereview:thread-summarymarker and no later human comment exists.Reviewer prompts should receive compact file-scoped summaries for both provider-resolved and CR-settled threads, while command output/diagnostics should make clear whether provider resolution actually happened.
Guardrails