Skip to content

[BUG] Repeated API Error 400 #1695

@shaunc

Description

@shaunc

Environment

  • Platform (select one):
    • Anthropic API
    • AWS Bedrock
    • Google Vertex AI
    • Other:
  • Claude CLI version: 1.0.16
  • Operating System: Ubuntu 22.04
  • Terminal: bash in vscode

Bug Description

I am getting an API error -- no matter what I type. Here is the last thing I typed:

> I had just asked you to create extensive documentation, as this was a tricky 
  issue. Read the mathematical background and the test design / analysis framework 
  carefully, then write documentation on how we tuned, and also user documentation 
  on how to select # of banks, configure, etc.
  ⎿ API Error: 400 
    {"type":"error","error":{"type":"invalid_request_error","message":"messages.17: 
    `tool_use` ids were found without `tool_result` blocks immediately after: 
    toolu_015REhjCAk7wvjVLAxx4tABq. Each `tool_use` block must have a corresponding 
    `tool_result` block in the next message."}}

Steps to Reproduce

This happened in the middle of a session. When I stopped and restarted (without continue), I still got the same error after two interactions. However, in another window, I was able to restart, and now running for 5 minutes.

Expected Behavior

Actual Behavior

Additional Context

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:apiarea:corebugSomething isn't workinghas reproHas detailed reproduction stepsplatform:linuxIssue specifically occurs on Linux

    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