[BUG] Session resume fails with "API Error: 400 Could not process image" when a tool result containing a PNG/SVG with iconbase64: fields
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Session resume fails with "API Error: 400 Could not process image" when a tool result containing a PNG/SVG (e.g. from reading YAML files with iconbase64: fields) gets stored as a structured {"type":"image","source":{"type":"base64",...}} content block in the session JSONL
Claude Code should either sanitize image content blocks before persisting to JSONL, or handle the 400 gracefully on resume instead of hard-crashing
What Should Happen?
Manually replace the image content block in the JSONL with {"type":"text","text":"[image-removed]"}
Error Messages/Logs
Steps to Reproduce
Steps to reproduce: Read a SUSE Observability / StackState node YAML file that contains an iconbase64: data:image/png;base64,... field → session stores it as an image content block → claude --resume
<session-id> fails immediately
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
2.1.141
Claude Code Version
latest
Platform
Google Vertex AI
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
Version: 2.1.141
Root cause in the JSONL: A tool result where the stdout was a data:image/png;base64,... string got stored with "isImage": true and serialized as a structured API image content block:
{
"tool_use_id": "toolu_vrtx_01L4wxsA5NMqazSvu6v7wMSS",
"type": "tool_result",
"content": [
{
"type": "image",
"source": {
"type": "base64",
"media_type": "image/png",
"data": "PHN2ZyB3aWR0aD0iMTgiIGhlaWdodD0iMQ=="
}
}
]
}
How to reproduce: Read a YAML file containing iconbase64: data:image/png;base64,... (common in SUSE Observability / StackState node definitions). Claude Code detects the base64 string as an image,
classifies the tool result as isImage: true, and persists it as an image content block. Every subsequent claude --resume for that session immediately fails.
Workaround: Manually replace the block in the JSONL with {"type":"text","text":"[image-removed]"}.
Suggested fix: Either don't persist image content blocks to JSONL (or strip them on resume), or catch the 400 on resume and continue with a degraded session instead of hard-crashing.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗