[bugfix] post AI review inline comments instead of buffering them - #665
Merged
tiankongdeguiji merged 1 commit intoSep 9, 2026
Merged
Conversation
The inline-comment MCP server from claude-code-action buffers every create_inline_comment call into /tmp/inline-comments-buffer.jsonl unless the caller passes confirmed=true, and only a post-step entrypoint that ships with the composite action drains that buffer. These jobs drive the claude and codex CLIs directly, so nothing ever drained it and no inline comment reached the PR -- only the top-level summary, which goes through gh pr comment. The runner's clone of the server picked the behavior up on its last update; before that every call posted live. Setting CLASSIFY_INLINE_COMMENTS=false in the server's environment turns the buffer off, so calls post as they are made again. The codex job needs its own copy of the variable because its config.toml env block is the server's whole environment rather than an inherited one. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BJg1zk3pFsjZdaUCWvjwBT
eric-gecheng
approved these changes
Sep 9, 2026
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.
Problem
The AI code review stopped posting inline comments. In run 34201597956 (PR #662) the reviewer made 11
create_inline_commentcalls, every one succeeded, and none reached the PR (GET /pulls/662/commentsreturns 0). Only the top-level summary landed, because that goes throughgh pr comment.Each call came back:
{"success": true, "buffered": true, "message": "Comment buffered. It will be classified and posted after this session completes ... Set confirmed=true to post immediately."}Root cause
claude-code-action'sgithub-inline-comment-server.tsappends every unconfirmed call to/tmp/inline-comments-buffer.jsonlinstead of posting it:The buffer is drained by a separate entrypoint,
src/entrypoints/post-buffered-inline-comments.ts, which the composite action runs as a post-step. Both jobs here drive the CLI directly with only--mcp-config/[mcp_servers], so that entrypoint never runs, the MCP server dies with the session, and the buffer stays on the runner.The behavior has been upstream since March; the runner's
git clone --branch v1of the action was older than that until its last update. Run34120554588(2026-09-07 12:41) still posted 11 inline comments live; run34201597956(2026-09-08 07:53) buffered all of them. Nothing in this repo changed —.claude/commands/review-pr.mdhas never mentionedconfirmed.Fix
Set
CLASSIFY_INLINE_COMMENTS=falsein the MCP server's environment in both jobs, which restores immediate posting. The codex job needs its own copy of the variable: its[mcp_servers.github_inline_comment.env]block is the server's whole environment, not an inherited one, which is also whyGITHUB_TOKENand friends are listed there explicitly.Two alternatives were rejected. Instructing the reviewers to pass
confirmed: truedepends on the model remembering the argument on every call and needs the same edit duplicated into the codex agent prompts. Adding the flush entrypoint as a post-step is worse still:post-buffered-inline-comments.tsreads the buffer but never truncates it, and on this persistent self-hosted runner the file has been accumulating since the regression — a flush without anrm -ffirst would spray one PR's comments onto the next.Test Plan
yaml.safe_loadon the workflow: parses, and theRunCodeReviewstep env carriesCLASSIFY_INLINE_COMMENTS: 'false'(string, so the server's!== "false"check sees it).tomllib: the generatedconfig.tomlparses with its preserved indentation andmcp_servers.github_inline_comment.envcarries the new key alongside the existing four.pre-commit run --files .github/workflows/code_review.yml: all applicable hooks pass.claude-review/codex-reviewlabel on a PR — inline comments should appear during the run rather than being reported as buffered.Unrelated follow-up worth doing on the runner: the setup instructions clone the action from a moving
v1branch, which is how a tool contract changed under CI unnoticed; pinning to a tag or SHA would prevent a repeat. The stale/tmp/inline-comments-buffer.jsonlthere can also be deleted.🤖 Generated with Claude Code
https://claude.ai/code/session_01BJg1zk3pFsjZdaUCWvjwBT