You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When use_sticky_comment: true is set but the action enters agent mode (because track_progress: false and a prompt is provided), the sticky comment feature silently breaks. No comment is ever created on the PR, even though the MCP comment server is included in the tool list.
The root cause is a code path gap in src/modes/agent/index.ts:
detectMode() in src/modes/detector.ts returns "agent" when track_progress is false and prompt is set
In src/modes/agent/index.ts line 105, claudeCommentId is hardcoded to undefined
Even though shouldIncludeCommentServer evaluates to true in install-mcp-server.ts (because mcp__github_comment__update_claude_comment is in allowedTools), the MCP server starts without CLAUDE_COMMENT_ID in its environment
Every call to update_claude_comment fails at line 42-44 of github-comment-server.ts with: "CLAUDE_COMMENT_ID environment variable is required"
Unlike tag mode, agent mode never calls createInitialComment() to create the comment and obtain its ID.
To Reproduce
Configure a workflow with track_progress: false, use_sticky_comment: true, and a prompt on a pull_request event (e.g., with types: [labeled])
Trigger the action by adding the label to a PR
The action runs successfully (Claude executes the prompt and produces output)
No sticky comment appears on the PR
Expected behavior
When use_sticky_comment: true, agent mode should create an initial comment (like tag mode does via createInitialComment()) and pass the resulting comment ID to the MCP server via CLAUDE_COMMENT_ID. The sticky comment should be updated throughout the run.
Workflow yml file
on:
pull_request:
types: [labeled]jobs:
review:
if: github.event.label.name == 'claude-review'runs-on: ubuntu-lateststeps:
- uses: anthropics/claude-code-action@v1with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}use_sticky_comment: trueprompt: | Review this pull request and post your findings as a comment.
Because track_progress defaults to false and prompt is set, this enters agent mode where the sticky comment is silently ignored.
Workaround: Setting track_progress: true forces tag mode where sticky comments work, but this isn't viable for all event types (e.g., labeled fails validateTrackProgressEvent).
Suggested fix: In agent/index.ts, when context.inputs.useStickyComment is true and the context is a PR or issue, call createInitialComment() and pass the resulting ID as claudeCommentId to prepareMcpConfig.
Describe the bug
When
use_sticky_comment: trueis set but the action enters agent mode (becausetrack_progress: falseand apromptis provided), the sticky comment feature silently breaks. No comment is ever created on the PR, even though the MCP comment server is included in the tool list.The root cause is a code path gap in
src/modes/agent/index.ts:detectMode()insrc/modes/detector.tsreturns"agent"whentrack_progressis false andpromptis setsrc/modes/agent/index.tsline 105,claudeCommentIdis hardcoded toundefinedshouldIncludeCommentServerevaluates totrueininstall-mcp-server.ts(becausemcp__github_comment__update_claude_commentis inallowedTools), the MCP server starts withoutCLAUDE_COMMENT_IDin its environmentupdate_claude_commentfails at line 42-44 ofgithub-comment-server.tswith:"CLAUDE_COMMENT_ID environment variable is required"Unlike tag mode, agent mode never calls
createInitialComment()to create the comment and obtain its ID.To Reproduce
track_progress: false,use_sticky_comment: true, and aprompton apull_requestevent (e.g., withtypes: [labeled])Expected behavior
When
use_sticky_comment: true, agent mode should create an initial comment (like tag mode does viacreateInitialComment()) and pass the resulting comment ID to the MCP server viaCLAUDE_COMMENT_ID. The sticky comment should be updated throughout the run.Workflow yml file
Because
track_progressdefaults tofalseandpromptis set, this enters agent mode where the sticky comment is silently ignored.API Provider
[x] Anthropic First-Party API (default)
[ ] AWS Bedrock
[ ] GCP Vertex
Additional context
track_progress: trueforces tag mode where sticky comments work, but this isn't viable for all event types (e.g.,labeledfailsvalidateTrackProgressEvent).agent/index.ts, whencontext.inputs.useStickyCommentis true and the context is a PR or issue, callcreateInitialComment()and pass the resulting ID asclaudeCommentIdtoprepareMcpConfig.