anthropics / anthropics/claude-code-action

Duplicated messages sent to Claude API

Abierto
#200 1 comentario 0 reacciones 0 asignados Ver en GitHub
bug p2
Lenguaje dominante
TypeScript
Estrellas
8.9k
Forks
2.1k
Merge medio
3 d 9 h
PR fusionados (30 d)
10

Descripción

**Describe the bug**
The 2nd request sent by claude to the API contains duplicated messages:

```json
{
"model": "claude-opus-4-20250514",
"tools": ["..."],
"stream": true,
"system": ["..."],
"messages": [
{
"role": "user",
"content": ["..."]
},
{
"role": "assistant",
"content": [
{
"type": "thinking",
"thinking": "Let me analyze the request:\n\n1. I'm being asked to run a `/project:verify_findings` command with `raw-findings/` as input and `verified-findings/` as output\n2. This is a direct prompt, not from a GitHub comment\n3. I need to look at the CLAUDE.md file first to understand repo-specific instructions\n\nLooking at the CLAUDE.md file, there is extensive information about PR review guidelines and specific patterns to look for. It seems like this is related to a PR review that has already been done, and now I need to verify the findings.\n\nThe PR is about improving MSP bucket download functionality. The comment history shows that Claude has already completed a review and found some issues.\n\nLet me check if this `/project:verify_findings` command is documented in the CLAUDE.md file or if there's more context I need.\n\nI see there are some new files added in this PR:\n- `.claude/commands/pr_checks.md` \n- `.claude/commands/verify_findings.md`\n\nThese might contain the command definition. Let me read them to understand what the verify_findings command is supposed to do.",
"signature": "EtcJCkYIBBgCKkBe55UGSbI9x3k1WHQZStkGjB+NwoXJatEWgZ192YuFYioykxCq/B5Cl55r3pGPfYlZtWONNjFSEwv4hrdmz2UAEgy1+xetRbgtpMMmehwaDABjfgxfWebGrgpDzyIwMfPUWSGuKSP6WjehiRPY+YNv3dHifw412Zx5BPF/QFKjVVbUbEZ6muGlQ9Y0IqctKr4IiGJp/S+zaJjDDJ7aRjnRyTHxhhDymXc/9I8Uvdq34+1CR48pmAApnAAbUW+cqP0pBpQoVC1Zn8Q7OzdL+tvVgELVonz1DSpl5RtPoiIPNxb+U3rpH+zkpzqn+wl1106kAJZQlnHevwcqgm5zQu9G1nn1th02OTGPq7h8pW0JcpKXtOfhN8myD9dX5d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2wLF9ktdzyxRteuyjuAjN+hJcUu1+DE1ak+6zGHL9KFBMBm8fbgr8T5R5Fvtyq3SvjO+d2Df8r94cbYOXCLFjIEyNO9ekSpFHLIrnnD60rfecYDHDn1mY9WPQuaxk1/4mGvFNS7HAVMCJZyfsXGvbWuwFiMhzrPBUrCv69GON5SDWrTnIYnQX64ULzEVAGAE="
},
{
"text": "\na. This is a direct prompt request to run `/project:verify_findings raw-findings/ verified-findings/`\nb. This appears to be a request for implementation/execution of a command, not a code review\nc. Key information:\n - PR is about improving MSP bucket download functionality\n - A review has already been completed and raw findings were exported to `raw-findings/`\n - The task is to verify these findings and output to `verified-findings/`\n - New command files were added in the PR that likely define this functionality\nd. Main tasks:\n - Read the verify_findings command documentation\n - Understand what the command does\n - Execute the verification process\n - Report results\ne. Plan:\n - First, read `.claude/commands/verify_findings.md` to understand the command\n - Check if `raw-findings/` directory exists and contains findings\n - Execute the verification process as documented\n - Update comment with results\nf. No major blockers expected - I have file read/write capabilities needed for this task\n\n\nI'll start by understanding what the verify_findings command does and then execute it.",
"type": "text"
},
{
"id": "toolu_01KXZWttj34a3shBwY6pSAhe",
"name": "mcp__github_file_ops__update_claude_comment",
"type": "tool_use",
"input": {
"body": "Claude Code is working… \n\n### Todo List:\n- [ ] Read verify_findings command documentation\n- [ ] Check raw-findings directory contents\n- [ ] Execute verification process\n- [ ] Update comment with results\n\nStarting verification of PR findings...\n\n[View job run](https://github.com/raynaudoe/storage-hub/actions/runs/15881046134)"
}
}
]
},
{
"role": "user",
"content": [
{
"type": "tool_result",
"content": [
{
"text": "{\n \"id\": 3005307421,\n \"html_url\": \"https://github.com/raynaudoe/storage-hub/pull/27#issuecomment-3005307421\",\n \"updated_at\": \"2025-06-25T15:57:14Z\"\n}",
"type": "text"
}
],
"tool_use_id": "toolu_01KXZWttj34a3shBwY6pSAhe"
}
]
},
{
"role": "assistant",
"content": [
{
"type": "thinking",
"thinking": "Let me analyze the request:\n\n1. I'm being asked to run a `/project:verify_findings` command with `raw-findings/` as input and `verified-findings/` as output\n2. This is a direct prompt, not from a GitHub comment\n3. I need to look at the CLAUDE.md file first to understand repo-specific instructions\n\nLooking at the CLAUDE.md file, there is extensive information about PR review guidelines and specific patterns to look for. It seems like this is related to a PR review that has already been done, and now I need to verify the findings.\n\nThe PR is about improving MSP bucket download functionality. The comment history shows that Claude has already completed a review and found some issues.\n\nLet me check if this `/project:verify_findings` command is documented in the CLAUDE.md file or if there's more context I need.\n\nI see there are some new files added in this PR:\n- `.claude/commands/pr_checks.md` \n- `.claude/commands/verify_findings.md`\n\nThese might contain the command definition. Let me read them to understand what the verify_findings command is supposed to do.",
"signature": "EtcJCkYIBBgCKkBe55UGSbI9x3k1WHQZStkGjB+NwoXJatEWgZ192YuFYioykxCq/B5Cl55r3pGPfYlZtWONNjFSEwv4hrdmz2UAEgy1+xetRbgtpMMmehwaDABjfgxfWebGrgpDzyIwMfPUWSGuKSP6WjehiRPY+YNv3dHifw412Zx5BPF/QFKjVVbUbEZ6muGlQ9Y0IqctKr4IiGJp/S+zaJjDDJ7aRjnRyTHxhhDymXc/9I8Uvdq34+1CR48pmAApnAAbUW+cqP0pBpQoVC1Zn8Q7OzdL+tvVgELVonz1DSpl5RtPoiIPNxb+U3rpH+zkpzqn+wl1106kAJZQlnHevwcqgm5zQu9G1nn1th02OTGPq7h8pW0JcpKXtOfhN8myD9dX5dGInXMaInK0a3LNWaVRYy0kYd+w1MIMAzPUdqk4aOUSPSWkLmD+X+su5bpIVXB5b74J1/mdN5djmvwvEqk4sVn/YsLGRRjMbHIOyB/LXzKdxyjrZQXlze+mb353G3sIW6i4p2twaOsCeRjsOPBuP+ADBbKIL8K3pxysQq3VPw2CzNNHGJzTvFs3vlkhL/9NhHRAyL+aWyHUfi+wktZmyRB1DmCtD9f06ui6Ddpx2DFzT3HBqUVAn9HhVz87/7QTbhDiHNoHyKzF+0LhEMTd7O1cypx6YZ4rFGN6W+ECZjbR09KuXPOi0OFrkFfuAyvIbtfG3Y/8HVrRNrbGa5qF57hv3vlPiVn/72Yx5NUI10H17H6ADG6aEKKzB22/IwRN3pTqWIAzUDdhvj08fvw28dDgDGgJMyx5StpuDy1mqOx8KytWbD7sgJs+2oDhwhv3Wc1LpwI9wr/cXb02CKL/TM0yjPVl8Kj2lM185ASLsWGim+qh6poC/FCi5/SStipx+VbvXiSPVHfG6DF/C7VrXGKoTml3E0pSoGLSL+ti7/5Y8cala2i8R5ns+D6Gaw3LKIpRlFETKVa2qOjYokJgWPntZYNEkwbknWUtHKmmifSXLN21AjaJDZ17xSbHOVO+XsoUSXQ4Efr+99pz0ALED5Sdq0VGw1//bfOVtmtc5vmKpUkjfYC4tlA5cgexeyCtOKcYBE6jqaMYy/86TzpGbrC5NcVMShdHD3uGTl03SRxqet+ZpwDajxKQcKnq//gXNfAMX3VqRZaW7nCvj50UmH9+y+DsQtH6ibpW8zhjnJozk5/40V56GzLj0fKn3Oo0jrvyWXTjG10l0nAQu53gnMIjUarkNs7A2LEj9qb0ewg/G6Tkcu0AkUsZSxWqM2ZVnl/qXVtGnmI3+ippdqlfH9ECE2MZLUF1KTBYoanDml65VX7CBcz1twey1aQa38U6Omk3DVRmGEAJ1IJiY4c9eSPWC8kl+tEPwq4GW8hV5B0h6iZRZ8KLcnq4ifv9VfaspCDSxDD0Ail+AoRfZ8eO+gQQLGBgEnwbgduqfo+PLuRaOYPAYKk2wLF9ktdzyxRteuyjuAjN+hJcUu1+DE1ak+6zGHL9KFBMBm8fbgr8T5R5Fvtyq3SvjO+d2Df8r94cbYOXCLFjIEyNO9ekSpFHLIrnnD60rfecYDHDn1mY9WPQuaxk1/4mGvFNS7HAVMCJZyfsXGvbWuwFiMhzrPBUrCv69GON5SDWrTnIYnQX64ULzEVAGAE="
},
{
"text": "\na. This is a direct prompt request to run `/project:verify_findings raw-findings/ verified-findings/`\nb. This appears to be a request for implementation/execution of a command, not a code review\nc. Key information:\n - PR is about improving MSP bucket download functionality\n - A review has already been completed and raw findings were exported to `raw-findings/`\n - The task is to verify these findings and output to `verified-findings/`\n - New command files were added in the PR that likely define this functionality\nd. Main tasks:\n - Read the verify_findings command documentation\n - Understand what the command does\n - Execute the verification process\n - Report results\ne. Plan:\n - First, read `.claude/commands/verify_findings.md` to understand the command\n - Check if `raw-findings/` directory exists and contains findings\n - Execute the verification process as documented\n - Update comment with results\nf. No major blockers expected - I have file read/write capabilities needed for this task\n\n\nI'll start by understanding what the verify_findings command does and then execute it.",
"type": "text"
},
{
"id": "toolu_01KXZWttj34a3shBwY6pSAhe",
"name": "mcp__github_file_ops__update_claude_comment",
"type": "tool_use",
"input": {
"body": "Claude Code is working… \n\n### Todo List:\n- [ ] Read verify_findings command documentation\n- [ ] Check raw-findings directory contents\n- [ ] Execute verification process\n- [ ] Update comment with results\n\nStarting verification of PR findings...\n\n[View job run](https://github.com/raynaudoe/storage-hub/actions/runs/15881046134)"
},
"cache_control": {
"type": "ephemeral"
}
}
]
},
{
"role": "user",
"content": [
{
"type": "tool_result",
"content": [
{
"text": "{\n \"id\": 3005307421,\n \"html_url\": \"https://github.com/raynaudoe/storage-hub/pull/27#issuecomment-3005307421\",\n \"updated_at\": \"2025-06-25T15:57:14Z\"\n}",
"type": "text"
}
],
"tool_use_id": "toolu_01KXZWttj34a3shBwY6pSAhe",
"cache_control": {
"type": "ephemeral"
}
}
]
}
],
"metadata": {
"user_id": "..."
},
"thinking": {
"type": "enabled",
"budget_tokens": 4000
},
"max_tokens": 32000,
"temperature": 1
}
```

**Expected behavior**
Claude normally only append 2 messages per request (the user + assistant) but here it appends 4 messages, which look like duplication since they have same content and same tool_user_id.

**Workflow yml file**
https://github.com/raynaudoe/storage-hub/actions/runs/15881046134/workflow

**API Provider**

[x] Anthropic First-Party API (default)

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.