Skip to content

Conversation

@rwese
Copy link

@rwese rwese commented Dec 14, 2025

when the agent creates images, by screenshot or otherwise, which produces and file, which is empty, calling the antrophic provider will fail and the chat session is broken, it will not allow you to continue.

Session Export:
session_empty_image_.json

The fix will check if there is any content, otherwise return a message to the agent, the test is entirely generated by the ai.

@rwese rwese force-pushed the errorhandling-empty-image branch 2 times, most recently from daa7e62 to 4ef61fe Compare December 14, 2025 12:29
@rwese
Copy link
Author

rwese commented Dec 14, 2025

just cleaned the git-history

@rekram1-node
Copy link
Collaborator

/review

@rwese rwese force-pushed the errorhandling-empty-image branch 2 times, most recently from 68a3f11 to 818af1b Compare December 14, 2025 16:37
@rekram1-node
Copy link
Collaborator

So I looked at your session, looks like this is related to anthropic, not zen. The code changes you made are for zen api endpoints. This is probably not what you are looking to do..

@rekram1-node
Copy link
Collaborator

Instead I think we should revert these changes and put the filter in this function:

function unsupportedParts(msgs: ModelMessage[], model: Provider.Model): ModelMessage[] {

@rwese
Copy link
Author

rwese commented Dec 14, 2025

@rekram1-node thank you, i will try fixing it there!

- Add validation in unsupportedParts to detect empty base64 image data
- Replace empty images with error text instead of sending to API
- Prevents Anthropic 'image cannot be empty' errors
- Add regression tests for empty image handling
@rwese rwese force-pushed the errorhandling-empty-image branch from 30248c3 to 0abd983 Compare December 14, 2025 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants