Error due to multiple tool messages with same tool_call_id #852

Closed
opened 2026-02-16 17:28:34 -05:00 by yindo · 2 comments
Owner

Originally created by @hoesler on GitHub (Jul 22, 2025).

Originally assigned to: @thdxr on GitHub.

Using 0.3.54, I got the following error from Copilot GPT 4.1 in build mode after creating a plan with gemini: AI_APICallError: Invalid parameter: Duplicate value for 'tool_call_id' of 'tool_0_glob', in messages[8] and messages[9].

Below is what I can find in the logs. It seems "Tool execution aborted" messages accidentally got appended to the chat.

           {
                "role": "tool",
                "tool_call_id": "tool_0_glob",
                "content": "Tool execution aborted"
            },
            {
                "role": "tool",
                "tool_call_id": "tool_0_glob",
                "content": "No files found"
            },
            {
                "role": "tool",
                "tool_call_id": "tool_1_glob",
                "content": "Tool execution aborted"
            },
            {
                "role": "tool",
                "tool_call_id": "tool_1_glob",
                "content": "No files found"
            },
            {
                "role": "tool",
                "tool_call_id": "tool_2_glob",
                "content": "Tool execution aborted"
            },
            {
                "role": "tool",
                "tool_call_id": "tool_2_glob",
                "content": "No files found"
            },
            {
                "role": "tool",
                "tool_call_id": "tool_3_read",
                "content": "Tool execution aborted"
            },
            {
                "role": "tool",
                "tool_call_id": "tool_3_read",
                "content": "<file>...</file>"
            },
            {
                "role": "tool",
                "tool_call_id": "tool_4_read",
                "content": "Tool execution aborted"
            },
            {
                "role": "tool",
                "tool_call_id": "tool_4_read",
                "content": "<file>...</file>"
            },
            {
                "role": "tool",
                "tool_call_id": "tool_5_read",
                "content": "Tool execution aborted"
            },
            {
                "role": "tool",
                "tool_call_id": "tool_5_read",
                "content": "<file>...</file>"
            },
Originally created by @hoesler on GitHub (Jul 22, 2025). Originally assigned to: @thdxr on GitHub. Using 0.3.54, I got the following error from Copilot GPT 4.1 in build mode after creating a plan with gemini: `AI_APICallError: Invalid parameter: Duplicate value for 'tool_call_id' of 'tool_0_glob', in messages[8] and messages[9].` Below is what I can find in the logs. It seems "Tool execution aborted" messages accidentally got appended to the chat. ``` { "role": "tool", "tool_call_id": "tool_0_glob", "content": "Tool execution aborted" }, { "role": "tool", "tool_call_id": "tool_0_glob", "content": "No files found" }, { "role": "tool", "tool_call_id": "tool_1_glob", "content": "Tool execution aborted" }, { "role": "tool", "tool_call_id": "tool_1_glob", "content": "No files found" }, { "role": "tool", "tool_call_id": "tool_2_glob", "content": "Tool execution aborted" }, { "role": "tool", "tool_call_id": "tool_2_glob", "content": "No files found" }, { "role": "tool", "tool_call_id": "tool_3_read", "content": "Tool execution aborted" }, { "role": "tool", "tool_call_id": "tool_3_read", "content": "<file>...</file>" }, { "role": "tool", "tool_call_id": "tool_4_read", "content": "Tool execution aborted" }, { "role": "tool", "tool_call_id": "tool_4_read", "content": "<file>...</file>" }, { "role": "tool", "tool_call_id": "tool_5_read", "content": "Tool execution aborted" }, { "role": "tool", "tool_call_id": "tool_5_read", "content": "<file>...</file>" }, ```
yindo closed this issue 2026-02-16 17:28:34 -05:00
Author
Owner

@hoesler commented on GitHub (Jul 22, 2025):

I just debugged a bit and the bug seems to be, that a "pending" tool call is treated a aborted here:

https://github.com/sst/opencode/blob/e4f754eee7b4725e1f9bcf98f2fab11aa44c0147/packages/opencode/src/session/index.ts#L1044

@hoesler commented on GitHub (Jul 22, 2025): I just debugged a bit and the bug seems to be, that a "pending" tool call is treated a aborted here: https://github.com/sst/opencode/blob/e4f754eee7b4725e1f9bcf98f2fab11aa44c0147/packages/opencode/src/session/index.ts#L1044
Author
Owner

@rekram1-node commented on GitHub (Dec 27, 2025):

[automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!

@rekram1-node commented on GitHub (Dec 27, 2025): [automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#852