Fix use_sticky_comment in agent mode#1128
Open
ElliotJLT wants to merge 1 commit intoanthropics:mainfrom
Open
Conversation
Fixes anthropics#1108. Agent mode skipped createInitialComment(), hardcoding claudeCommentId to undefined. This meant the MCP server started without a comment ID, so sticky comments never worked in agent mode. Now calls createInitialComment() when useStickyComment is enabled and the context is an entity (PR or issue), matching the existing tag mode behavior.
olegshilov
approved these changes
Apr 8, 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.
Summary
Fixes #1108.
use_sticky_commentwas broken in agent mode becauseprepareAgentModehardcodedclaudeCommentIdtoundefined, skipping thecreateInitialComment()call that tag mode performs.Now calls
createInitialComment(octokit.rest, context)whenuseStickyCommentis enabled and the context is an entity (PR or issue), matching the existing tag mode pattern. Automation contexts (workflow_dispatch, schedule) where there is no entity to comment on are unaffected — both IDs remainundefined.Test plan
use_sticky_comment: trueon a PR event — verify a single comment is created and updateduse_sticky_comment: false— verify no change in behaviorworkflow_dispatchevent — verify no comment is created (no entity context)use_sticky_comment: true— verify existing behavior is unchanged