You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] tool-result image attachments are re-fed to text-only models #43388
Expected Behavior\nTool-result image attachments should not be sent back to models that do not support image input. The image should be downgraded to a safe text placeholder or otherwise stripped so the session can continue.\n\n## Current Behavior\nWhen a tool returns an image attachment, text-only models can receive a file/media part and fail with errors like: .\n\n## Steps to Reproduce\n1. Use a tool that returns an image attachment (for example an image generation tool).\n2. Run the session with a model whose is false.\n3. The image attachment is projected back into the model input and the run fails.\n\n## Root Cause\n decides whether tool-result media can be forwarded using provider-specific heuristics instead of the model capability flags. The current path can preserve media for models that are text-only, which makes the downstream model input invalid.\n\n## Suggested Fix\nGate tool-result media forwarding on / , and downgrade unsupported media to a text placeholder instead of a file attachment.\n\n## Verification\n- Added a regression test covering unsupported image tool-result media for a text-only model.\n- Added a regression test covering unsupported PDF tool-result media.\n- Existing Bedrock PDF case still preserves PDF media for a PDF-capable model.\n\n## Notes\nThe repo currently reports the session error as a model input failure, but the underlying bug is in opencode's media projection path, not the user tool itself.
Activity
github-actions commentedon Aug 19, 2026
This issue might be a duplicate of existing issues. Please check:
supportsMediaInToolResultnot respectingcapabilities.input.image) and the same symptom (session bricked by 400 errors on every subsequent turn).@ai-sdk/anthropicand@ai-sdk/openai, same proposed fix.Please review those issues and consider adding context there rather than opening a new report.
github-actions commentedon Oct 19, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.