Skip to content

fix(tag-mode): enable inline PR comments alongside sticky comments#1046

Open
sunnypatell wants to merge 4 commits intoanthropics:mainfrom
sunnypatell:fix/enable-inline-comments-tag-mode
Open

fix(tag-mode): enable inline PR comments alongside sticky comments#1046
sunnypatell wants to merge 4 commits intoanthropics:mainfrom
sunnypatell:fix/enable-inline-comments-tag-mode

Conversation

@sunnypatell
Copy link
Copy Markdown

fixes #955

tag mode never included mcp__github_inline_comment__create_inline_comment in its allowed tools, so the inline comment MCP server was never started for PR contexts. this made it impossible to post review feedback on specific diff lines when using @claude mentions, and the problem surfaced clearly when users enabled use_sticky_comment: true since both features should work together.

root cause

tagModeTools in src/modes/tag/index.ts included the comment server (mcp__github_comment__update_claude_comment) and CI tools, but not the inline comment tool. without that tool in the allowed list, prepareMcpConfig in install-mcp-server.ts skipped starting the github_inline_comment server entirely (the hasInlineCommentTools check on line 80 was always false for tag mode).

fix

+  if (context.isPR) {
+    tagModeTools.push("mcp__github_inline_comment__create_inline_comment");
+  }

conditionally adds the inline comment tool to tag mode's allowed tools for PR contexts. this causes prepareMcpConfig to:

  1. start the inline comment MCP server
  2. include the tool in the --allowedTools flag passed to the Claude CLI

the sticky comment feature (controlled by create-initial.ts) is completely orthogonal to inline comments. sticky controls how the main tracking comment is created/updated, while inline comments are separate PR review comments on diff lines. both now coexist.

tests

  • added test verifying inline comment server is excluded for non-PR contexts (issues)
  • added test verifying both github_comment and github_inline_comment servers coexist when useStickyComment: true on a PR context

all 654 tests pass.

Copilot AI review requested due to automatic review settings March 11, 2026 21:52
- added `mcp__github_inline_comment__create_inline_comment` to tag mode's
  allowed tools when the context is a PR
- the inline comment MCP server was previously only available in agent mode
  or when explicitly passed via `claude_args`, making it impossible to post
  review feedback on specific diff lines in tag mode
- this allows sticky comments (for the main tracking comment) and inline
  comments (for code-level review feedback) to coexist
- added tests verifying inline comments are excluded for non-PR contexts
  and that both comment servers work together with sticky comments enabled

closes anthropics#955
@sunnypatell sunnypatell force-pushed the fix/enable-inline-comments-tag-mode branch from 863638f to 162843d Compare March 11, 2026 21:52
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enables GitHub inline PR comment support in tag mode for PR contexts, and adds tests to validate when the inline-comment MCP server is (and isn’t) included in the generated MCP config.

Changes:

  • Automatically add the mcp__github_inline_comment__create_inline_comment tool in tag mode when context.isPR is true.
  • Add tests ensuring the inline-comment server is excluded for non-PR contexts, and coexists with the standard comment server for PRs.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/modes/tag/index.ts Adds inline-comment tool to the tag-mode allowed tool list for PR contexts.
test/install-mcp-server.test.ts Adds coverage around inline-comment server inclusion/exclusion in prepareMcpConfig.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread src/modes/tag/index.ts
Comment thread test/install-mcp-server.test.ts Outdated
- changed "should include inline comment server alongside sticky comment
  support for PRs" to "should include both comment and inline comment
  servers for PR contexts" since the test validates server coexistence,
  not sticky comment behavior specifically
@tombrov
Copy link
Copy Markdown

tombrov commented Mar 29, 2026

@wolffiex It would be appreciated if this could be addressed soon, its a feature that I know several people would like to have

@km-anthropic
Copy link
Copy Markdown
Collaborator

@claude review

Comment thread src/modes/tag/index.ts
- extracted dedupedTools and used it for both prepareMcpConfig and
  the --allowedTools cli string
- prevents duplicates when user CLAUDE_ARGS includes a tool we also push
  (e.g. mcp__github_inline_comment__create_inline_comment on PRs)
@sunnypatell
Copy link
Copy Markdown
Author

sunnypatell commented Apr 27, 2026

@tombrov @km-anthropic @wolffiex addressed all outstanding review feedback in 8f49f3f, all three review threads resolved.

…omments-tag-mode

# Conflicts:
#	src/modes/tag/index.ts
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.

Sticky comments with inline in PR review

4 participants