lmstudio-ai / lmstudio-ai/localization

[CLI] API Error 400: Only text tool_result blocks are supported when reading local image files in the latest Claude Code terminal

Open
#425 2 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
No language data
Stars
1
Forks
0
Avg merge
11h 4m
Merged PRs (30d)
2

Description

Description:
I am encountering an API 400 error when using the latest version of the Claude Code terminal to read a local image file. It appears that the file-reading tool returns the image content in a format incompatible with the expected tool_result schema (likely returning a raw image block instead of wrapping it in a text block).
Steps to Reproduce:
Open the latest Claude Code terminal (CLI).
Provide a prompt asking the agent to read a local image file.
Example prompt: "C:\Users\gzcti\Pictures\c07299b8738fc86e3b1abb11ee26a2e1.jpg"读取图片信息
The agent attempts to read the file and immediately crashes with an API validation error.
Expected Behavior:
The Claude Code CLI should successfully process the image and return a description, or gracefully handle the image output by wrapping it in a valid {type: "text", text: "..."} block before sending it back as a tool_result.
Actual Behavior:
The process fails with the following API 400 error:
text

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the failure in the latest Claude Code terminal with the local image prompt described in the report. No repository files or tests are identified; done means the image is processed successfully or the tool output is converted to a valid text tool_result without the API 400 error.

Written by the indexing model from the issue text.

Assessment

Domain
api, cli
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.