Skip to content

[BUG] "Could not process image" is a non-recoverable API error #1747

@milieu

Description

@milieu

Environment

  • Platform (select one):
    • Anthropic API
    • AWS Bedrock
    • Google Vertex AI
    • Other:
  • Claude CLI version: 1.0.17 (Claude Code)
  • Operating System: macOS 16.4
  • Terminal: Cursor / iTerm2

Bug Description

Two API errors are not recoverable by Claude Code, and will make a session completely unrecoverable:

  1. "Could not process image"
> That's fine, please don't process the image
  ⎿  API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"Could not process image"}}
"`tool_use` ids were found without `tool_result` blocks immediately after: toolu_XXXXXX. Each `tool_use` block must have a corresponding `tool_result` block in the next message."

See below.

This second error seems to be a duplicate report of #1738

Steps to Reproduce

The conversation prior to this specific error... was me trying to recover another Claude Code session, where I had been trying to create Linear issues, and attaching images I had already uploaded in another Linear comment.

In a subsequent Claude session, I had pasted those errors, and it responded in this way and tried to download and process the images, even though I did not need it to.

⏺ It looks like your Claude Code session got into a corrupted state when you interrupted the image download. The error shows that there's an incomplete tool use block that's missing its corresponding
 result block, which is causing the API to reject all subsequent requests.

  Unfortunately, I can't directly recover that specific session - each Claude Code conversation is independent. However, I can help you continue where you left off by:

  1. Recreating the work: I can help you download those images with the proper names and continue with the ticket creation
  2. Understanding the context: From what I can see, you were working on extracting images from a Linear comment and creating tickets

  Let me help you get back on track. First, let me download those images with the names you specified:

⏺ Bash(curl -s "https://uploads.linear.app/486c4795-59f2-4440-a8aa-1344bb33eb56/3e6ae281-b8e6-445c-8f1c-ec9a87362c9d/fc02bbc6-7f80-4114-9c04-946c9fce61c2" -o before.pn…)
  ⎿  (No content)

⏺ Bash(curl -s "https://uploads.linear.app/486c4795-59f2-4440-a8aa-1344bb33eb56/d08faf25-f56e-4a6d-91ab-a7c393a0f1c6/62c94dd0-3eac-4786-867c-f4feb8cddda8" -o after.png)
  ⎿  (No content)

⏺ Bash(curl -s "https://uploads.linear.app/486c4795-59f2-4440-a8aa-1344bb33eb56/5e17e9b1-c6c1-4395-9d5c-4e7e2cf18b31/8a3e0476-2055-4b8f-a3e0-25b2ddf39a1a" -o formula-o…)
  ⎿  (No content)

⏺ Great! Now let me view the images to understand what we're working with:

⏺ Read(before.png)
  ⎿  Read image (194 bytes)

⏺ Read(after.png)
  ⎿  Read image (194 bytes)

⏺ Read(formula-option-2.png)
  ⎿  Read image (194 bytes)
  ⎿  API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"Could not process image"}}

The context of the previous broken session I was trying to fix... that I had given this session:

  For Ticket 3, I'll need to get those images you mentioned to show the before/after for the PBS page. Should I try to access them from the Linear comment, or would you prefer to share them directly?

  Ready to create the project when you confirm this structure looks right!

> All 3 images from that Linear comment. Yes, those tickets look right. I was hoping you could help fill in information for each ticket for me, too; prompt me as needed.

⏺ Perfect! Let me extract the images from that Linear comment first, then I'll prompt you for the ticket details.

⏺ Bash(curl -s "https://uploads.linear.app/486c4795-59f2-4440-a8aa-1344bb33eb56/3e6ae281-b8e6-445c-8f1c-ec9a87362c9d/fc02bbc6-7f80-4114-9c04-946c9fce61c2" -o image1.pn…)
  ⎿  (No content)

⏺ Bash(curl -s "https://uploads.linear.app/486c4795-59f2-4440-a8aa-1344bb33eb56/d08faf25-f56e-4a6d-91ab-a7c393a0f1c6/62c94dd0-3eac-4786-867c-f4feb8cddda8" -o image2.pn…)
  ⎿  Interrupted by user
  ⎿  Interrupted by user

> Can you name the images you see in the comment, in this order: before, after, true-balance-formula ?
  ⎿  API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.33: `tool_use` ids were found without `tool_result` blocks immediately after: toolu_01ACLezEp2N7EJHkkj5
NN9d2. Each `tool_use` block must have a
     corresponding `tool_result` block in the next message."}}

> Just retry
  ⎿  API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.33: `tool_use` ids were found without `tool_result` blocks immediately after: toolu_01ACLezEp2N7EJHkkj5
NN9d2. Each `tool_use` block must have a
     corresponding `tool_result` block in the next message."}}

> Hey, let's create those tickets. Are you feeling better?
  ⎿  API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.33: `tool_use` ids were found without `tool_result` blocks immediately after: toolu_01ACLezEp2N7EJHkkj5
NN9d2. Each `tool_use` block must have a
     corresponding `tool_result` block in the next message."}}

> What is my session id?
  ⎿  API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.33: `tool_use` ids were found without `tool_result` blocks immediately after: toolu_01ACLezEp2N7EJHkkj5
NN9d2. Each `tool_use` block must have a
     corresponding `tool_result` block in the next message."}}

> /bug
  ⎿  Error submitting bug report

Expected Behavior

  1. Asking to try doing something else, should work
  2. claude --resume and going back to that session, should let me continue the session without resending the same commands that get the same error.

Actual Behavior

  1. Claude Code became unresponsive regardless of input, and would repeat the same error message over and over again
  2. Ditto.

Additional Context

The "formula-option-2" third image that failed image processing:

Image

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