Allowing multiple specialized bot in the same PR (using smart invisible tags)#780
Open
FreCap wants to merge 7 commits intoanthropics:mainfrom
Open
Allowing multiple specialized bot in the same PR (using smart invisible tags)#780FreCap wants to merge 7 commits intoanthropics:mainfrom
FreCap wants to merge 7 commits intoanthropics:mainfrom
Conversation
Critical fix for multi-bot support. When multiple bots use the same bot ID (e.g., Claude's official bot ID 41898282), they were matching each other's comments due to the OR logic in comment matching. New logic: - If comment has a hidden header, require BOTH header AND ID to match - This prevents Bot A from matching Bot B's comment when they share an ID - Maintains backward compatibility for old comments without headers Without this fix, claude-security and claude-code-review would overwrite each other's comments.
|
related issue -- #419 |
4 tasks
|
here's my take on this -- #789 |
- Add pagination to fetch all comments (fixes PRs with 30+ comments) - Use case-insensitive, whitespace-tolerant regex for header matching - Replace exact body match with content-based matching for legacy comments - Add comprehensive test coverage for sticky comment scenarios
The updateCommentBody() function was stripping the <!-- bot: {botName} -->
header when transforming the comment body after Claude finishes. This caused
duplicate comments on subsequent PR pushes since the sticky comment matching
could not find the header.
Now the function extracts and preserves the bot header from the original
comment body, prepending it to the final result.
- Error case with bot header - Combined with branch/PR links - Header not at start of comment (security) - Complex bot names with hyphens, underscores, numbers
The MCP update_claude_comment tool was overwriting the entire comment body without preserving the <!-- bot: name --> header, causing sticky comment matching to fail on subsequent PR pushes. - Extract extractBotHeader() into shared utility in common.ts - Update MCP server to fetch current comment and preserve header - Update comment-logic.ts to use shared utility - Add 10 tests for extractBotHeader including MCP simulation test
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.
Allowing multiple Claude Reviewers in the same PR by changing the bot_name (e.g. security_review vs science_skills)
Implementation detail
Adding an hidden Header Identification (src/github/operations/comments/common.ts)
- Adds header when useStickyComment=true
- Invisible to users, used for bot identification
Following up on the previous request #411 with a simplified approach