Skip to content

Fix use_sticky_comment in agent mode#1128

Open
ElliotJLT wants to merge 1 commit intoanthropics:mainfrom
ElliotJLT:fix/agent-sticky-comment-1108
Open

Fix use_sticky_comment in agent mode#1128
ElliotJLT wants to merge 1 commit intoanthropics:mainfrom
ElliotJLT:fix/agent-sticky-comment-1108

Conversation

@ElliotJLT
Copy link
Copy Markdown

Summary

Fixes #1108. use_sticky_comment was broken in agent mode because prepareAgentMode hardcoded claudeCommentId to undefined, skipping the createInitialComment() call that tag mode performs.

Now calls createInitialComment(octokit.rest, context) when useStickyComment is 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 remain undefined.

Test plan

  • Run agent mode with use_sticky_comment: true on a PR event — verify a single comment is created and updated
  • Run agent mode with use_sticky_comment: false — verify no change in behavior
  • Run agent mode on a workflow_dispatch event — verify no comment is created (no entity context)
  • Run tag mode with use_sticky_comment: true — verify existing behavior is unchanged

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.
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.

use_sticky_comment has no effect in agent mode — MCP server starts without CLAUDE_COMMENT_ID

2 participants