Skip to content

[BUG] 400 invalid_request_error with Experimental Parallel Tool Calls after 20-30 conversation turns #9700

@SilentFlower

Description

@SilentFlower

Problem (one or two sentences)

When using the Anthropic provider with the experimental "Parallel tool calls" feature enabled, a bug may occur after the number of conversation turns reaches a certain threshold (approximately 20-30 turns).

The API call fails and returns a 400 invalid_request_error.

Error Response:

{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "messages.70: tool_use ids were found without tool_result blocks immediately after: toolu_01FZKGcgUxLCjjJqsvMMFyHH. Each tool_use block must have a corresponding tool_result block in the next message."
},
"request_id": "req_011CVdnBbidP19zWhjmu5Rj5"
}

Context (who is affected and when)

When using the Anthropic provider with the experimental "Parallel tool calls" feature enabled, a bug may occur after the number of conversation turns reaches a certain threshold (approximately 20-30 turns).

Reproduction steps

0.use Anthropic provider
1.enable tool call native
2.enable experimental "Parallel tool calls" feature
3.approximately 20-30 turns

Expected result

Engage in a normal conversation

Actual result

400 error

Variations tried (optional)

No response

App Version

3.34.8

API Provider (optional)

Anthropic

Model Used (optional)

No response

Roo Code Task Links (optional)

No response

Relevant logs or errors (optional)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue/PR - TriageNew issue. Needs quick review to confirm validity and assign labels.bugSomething isn't working

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions