Skip to content

[BUG] API Error: 400 tool_use ids were found without tool_result blocks immediately after: toolu_..... Each tool_use block must have a corresponding tool_result block in the next message. #3886

@ivan-velikanov

Description

@ivan-velikanov

Environment

  • Platform (select one):
    • Anthropic API
    • AWS Bedrock
    • Google Vertex AI
    • Other: Claude Pro used for accessing anthropic api
  • Claude CLI version: 1.0.55
  • Operating System: Windows 11, WSL Ubuntu
  • Terminal: ZSH

Bug Description

Anything I do is getting blocked with this error:

API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.251:
    `tool_use` ids were found without `tool_result` blocks immediately after:
    toolu_01NQv98A7JdU62r8UxsPZecG. Each `tool_use` block must have a corresponding `tool_result` block in
    the next message."}}

Steps to Reproduce

  1. use normally
  2. let is auto upgrade to 1.0.55
  3. notice this issue

Expected Behavior

This error should not at all come.

Actual Behavior

After auto upgrade to 1.0.55 anything i do results in this error.

Additional Context

Earlier today this error happend -> #3836 with version 1.0.54, now i see this error with 1.0.55
I also faced a lot of API Error: Request timed out. but it went fine mostly.
Maybe claude code/claude cli could have options to prevent auto-upgrade and options to allow downgrade (this way we can test and confirm, if the problem is in a particular version)
Related issue: #1894

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions