Skip to content

fix: create sticky comment in agent mode when useStickyComment is enabled#1120

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

fix: create sticky comment in agent mode when useStickyComment is enabled#1120
majiayu000 wants to merge 1 commit intoanthropics:mainfrom
majiayu000:fix/issue-1108-sticky-comment-agent-mode

Conversation

@majiayu000
Copy link
Copy Markdown

Fixes #1108

Summary

  • In agent mode, claudeCommentId was hardcoded to undefined in prepareAgentMode, so the MCP comment server never received CLAUDE_COMMENT_ID even when use_sticky_comment was enabled.
  • Added the same createInitialComment call that tag mode uses: when useStickyComment is true and the context is entity-based (PR/issue), it creates the initial comment and passes the ID to prepareMcpConfig.
  • Automation contexts (workflow_dispatch, schedule) with no entity skip comment creation gracefully.

Test plan

  • Added tests verifying createInitialComment is called when useStickyComment=true with entity context, and that the returned commentId is passed through to the result and MCP config.
  • Added tests verifying createInitialComment is NOT called for automation contexts or when useStickyComment=false.
  • bun test (654 pass), bun run typecheck, bun run format:check all pass.

…bled

When useStickyComment is true and the context is entity-based (PR/issue),
agent mode now creates an initial tracking comment and passes the comment
ID to the MCP config. Previously, claudeCommentId was hardcoded to
undefined, causing the MCP server to start without CLAUDE_COMMENT_ID.

Signed-off-by: majiayu000 <1835304752@qq.com>
@majiayu000 majiayu000 marked this pull request as ready for review March 24, 2026 10:49
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

1 participant