From a7c8ca2cf4f885e39908b66ae7737976d701b2f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A9=E9=82=91?= Date: Tue, 8 Sep 2026 17:44:38 +0800 Subject: [PATCH] [bugfix] post AI review inline comments instead of buffering them 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 Claude-Session: https://claude.ai/code/session_01BJg1zk3pFsjZdaUCWvjwBT --- .github/workflows/code_review.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/code_review.yml b/.github/workflows/code_review.yml index 2a2bceaa..8ee98388 100644 --- a/.github/workflows/code_review.yml +++ b/.github/workflows/code_review.yml @@ -186,8 +186,13 @@ jobs: REPO_OWNER: ${{ github.repository_owner }} REPO_NAME: ${{ github.event.repository.name }} PR_NUMBER: ${{ github.event.pull_request.number }} + # Post inline comments as they are created. Left unset, the MCP server + # buffers them into /tmp for a post-step that only claude-code-action + # runs; these jobs drive the CLI directly, so nothing would post them. + CLASSIFY_INLINE_COMMENTS: "false" # No ANTHROPIC_API_KEY — uses stored OAuth from `claude /login` on the runner - # MCP server inherits env vars (GITHUB_TOKEN, REPO_OWNER, REPO_NAME, PR_NUMBER) + # MCP server inherits env vars (GITHUB_TOKEN, REPO_OWNER, REPO_NAME, + # PR_NUMBER, CLASSIFY_INLINE_COMMENTS) run: | set -euo pipefail @@ -314,7 +319,9 @@ jobs: grep -q '^model *=' "$CODEX_HOME/config.toml" || { echo "::error::set model = \"...\" in the runner's ~/.codex/config.toml"; exit 1; } - # The MCP server gets its token here (config file, not argv or codex env) + # The MCP server gets its token here (config file, not argv or codex + # env), and this block is its whole environment, so the inline-comment + # buffer opt-out has to be repeated here cat >> "$CODEX_HOME/config.toml" << EOF [mcp_servers.github_inline_comment] @@ -327,6 +334,7 @@ jobs: REPO_OWNER = "${REPO_OWNER}" REPO_NAME = "${REPO_NAME}" PR_NUMBER = "${PR_NUMBER}" + CLASSIFY_INLINE_COMMENTS = "false" EOF chmod 600 "$CODEX_HOME/config.toml"