Skip to content

Deliver review summaries through the native MCP tool - #133

Open
gontzess wants to merge 2 commits into
mainfrom
steve.gontzes/review-summary-body
Open

gontzess wants to merge 2 commits into
mainfrom
steve.gontzes/review-summary-body

Conversation

@gontzess

@gontzess gontzess commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Why

Sending complete review summaries inside shell heredocs can exceed Claude Code's command-analysis limit or trigger shell-safety approval, leaving a shortened report without its AI-agent appendix. Agent mode also stopped automatically supplying the PR description, making author intent depend on a separate model-initiated query.

Changes

  • Reuse the existing upstream mcp__github_comment__update_claude_comment tool; no custom MCP server or new dependency.
  • Before the model runs, validate repository/PR/checkout/live-head identity, create a fresh provisional working comment and bind its ID through CLAUDE_COMMENT_ID.
  • Send provisional and final Markdown as tool data, retaining upstream sanitization and secret redaction. GitHub's comment-size limit still applies; the shell's command-length limit does not.
  • Preserve the complete author-written PR description as pr_body from the existing PR metadata request. Read title/description as untrusted claims to verify against the diff, never as review instructions or verdict policy. No extra API call or permission is needed.
  • Preserve CI-owned completed reports, exact-head verdicts, finality checks and completion-before-supersession. Ambiguous working-comment creation fails closed rather than reusing another run's slot or blindly retrying.

No model, effort, runtime pin, background-task policy or shell permission expansion relative to #132. Existing broad gh api capability remains; this is not credential isolation.

Latest validation

  • 138 reviewer tests passed locally. Four preparation tests caught 13 targeted compiling mutations.
  • Before/after context smoke reproduced the old description omission, then verified complete 23,400-character Markdown, empty/null descriptions, preservation through preparation and unchanged API-request counts.
  • A real full 89-finding workflow replay passed on this exact PR head. The entire 1,354-character PR description matched GitHub and appeared in the successful context-read output, independent of an additional description/CI-status query.
  • Native MCP delivered both summaries. The 14,416-character final body, including the AI-agent appendix, was retained intact in the archived working comment. Foreground subagents completed, then CI published the completed report and exact-head CHANGES_REQUESTED verdict before superseding prior output. No shell summary writes or weakened publication guards.
  • Scoped source/security review found no blocker. These checks validate input delivery, transport and publication—not the correctness of every model finding or immunity to prompt injection.

Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
@gontzess
gontzess marked this pull request as ready for review September 25, 2026 14:20
@gontzess
gontzess marked this pull request as draft September 25, 2026 15:17
Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
@gontzess
gontzess marked this pull request as ready for review September 25, 2026 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant