Skip to content

Commit 863638f

Browse files
committed
fix(tag-mode): enabled inline PR comments alongside sticky comments
- 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 #955
1 parent 567be3d commit 863638f

2 files changed

Lines changed: 49 additions & 0 deletions

File tree

src/modes/tag/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,12 @@ export async function prepareTagMode({
131131
...userAllowedMCPTools,
132132
];
133133

134+
// Enable inline PR comments for PR contexts so Claude can post
135+
// review feedback directly on diff lines alongside the tracking comment
136+
if (context.isPR) {
137+
tagModeTools.push("mcp__github_inline_comment__create_inline_comment");
138+
}
139+
134140
// Add git commands when using git CLI (no API commit signing, or SSH signing)
135141
// SSH signing still uses git CLI, just with signing enabled
136142
if (!useApiCommitSigning) {

test/install-mcp-server.test.ts

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,4 +313,47 @@ describe("prepareMcpConfig", () => {
313313
const parsed = JSON.parse(result);
314314
expect(parsed.mcpServers.github_ci).not.toBeDefined();
315315
});
316+
317+
test("should not include inline comment server for non-PR contexts", async () => {
318+
const result = await prepareMcpConfig({
319+
githubToken: "test-token",
320+
owner: "test-owner",
321+
repo: "test-repo",
322+
branch: "test-branch",
323+
baseBranch: "main",
324+
allowedTools: ["mcp__github_inline_comment__create_inline_comment"],
325+
mode: "tag",
326+
context: mockContext, // isPR: false
327+
});
328+
329+
const parsed = JSON.parse(result);
330+
expect(parsed.mcpServers.github_inline_comment).not.toBeDefined();
331+
});
332+
333+
test("should include inline comment server alongside sticky comment support for PRs", async () => {
334+
const mockPRContextWithSticky: ParsedGitHubContext = {
335+
...mockPRContext,
336+
inputs: {
337+
...mockPRContext.inputs,
338+
useStickyComment: true,
339+
},
340+
};
341+
342+
const result = await prepareMcpConfig({
343+
githubToken: "test-token",
344+
owner: "test-owner",
345+
repo: "test-repo",
346+
branch: "test-branch",
347+
baseBranch: "main",
348+
allowedTools: ["mcp__github_inline_comment__create_inline_comment"],
349+
mode: "tag",
350+
context: mockPRContextWithSticky,
351+
});
352+
353+
const parsed = JSON.parse(result);
354+
// Both comment server (for sticky tracking comment) and inline comment server should coexist
355+
expect(parsed.mcpServers.github_comment).toBeDefined();
356+
expect(parsed.mcpServers.github_inline_comment).toBeDefined();
357+
expect(parsed.mcpServers.github_inline_comment.env.PR_NUMBER).toBe("456");
358+
});
316359
});

0 commit comments

Comments
 (0)