Steps to Reproduce
- Start a conversation session in ZCode
- Send an image (e.g., a screenshot) in one of the messages — this creates an
image_url content block in the message history
- Switch the model to a text-only model that does not support multimodal input (e.g., DeepSeek)
- Send any new message
- The request fails with the above error
- Closing and reopening ZCode does NOT fix the issue — the image remains in the persisted session history
Expected Behavior
ZCode should detect when the target model does not support image_url content and automatically filter out or convert image messages before sending the request to the model. This is a standard practice in multi-model routing (e.g., Claude Code handles this gracefully by stripping image content when falling back to text-only models).
Alternatively, at minimum:
- The user should be warned before switching to a model that cannot handle the existing image content
- There should be an easy way to clear image content from the session without losing the entire conversation
Actual Behavior
- The request fails with an
invalid_request_error
- The error is permanent — every new message in the same session keeps failing
- Closing and reopening ZCode does not help because the session history (including the image) is persisted
- The user is forced to abandon the entire session and start over
Environment
- ZCode version: 3.1.1 (latest as of June 2026)
- Model: deepseek-v4-pro
- Platform: macOS (darwin arm64)
Suggested Fix
In the model routing/proxy layer, before sending messages to a text-only model:
- Check if any message contains
image_url content blocks
- Strip those content blocks (or replace them with a text placeholder like
[image omitted — model does not support images])
- Only send
text content blocks to the model
This ensures backward compatibility with text-only models without requiring user intervention.
Steps to Reproduce
image_urlcontent block in the message historyExpected Behavior
ZCode should detect when the target model does not support
image_urlcontent and automatically filter out or convert image messages before sending the request to the model. This is a standard practice in multi-model routing (e.g., Claude Code handles this gracefully by stripping image content when falling back to text-only models).Alternatively, at minimum:
Actual Behavior
invalid_request_errorEnvironment
Suggested Fix
In the model routing/proxy layer, before sending messages to a text-only model:
image_urlcontent blocks[image omitted — model does not support images])textcontent blocks to the modelThis ensures backward compatibility with text-only models without requiring user intervention.