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
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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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