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
Tool progress messages rejected by streaming validator due to invalid union type #36428
When opencode runs tool calls, it sometimes fails with:
Opencode failed to send message with error: Type validation failed:
Value: {"tool":"search_files","emoji":"🔎","label":"*","toolCallId":"call_00_ldqno5lweRBQjYVaLOab5496","status":"running"}
Tool progress/status messages ({tool, emoji, label, toolCallId, status}) are being sent through the same streaming channel as OpenAI-format response chunks. The Zod union validator on that endpoint expects either {"choices": [...]} or {"error": {...}}. The progress message structure matches neither variant.
Suggested fix
Either send progress messages through a separate channel, or wrap them in a valid format (e.g. add an empty choices array or nest the progress data as a sub-field of a valid message).
This issue might be a duplicate of existing issues. Please check:
SSE named events from custom providers cause type validation failure and break streaming #28833: Describes the same invalid_union validation failure for tool progress messages (containing tool, emoji, label, toolCallId, status) being passed through the OpenAI streaming validator, with the exact same error structure and the same suggested fix of filtering or routing these messages separately.
Activity
github-actions commentedon Jul 11, 2026
This issue might be a duplicate of existing issues. Please check:
invalid_unionvalidation failure for tool progress messages (containingtool,emoji,label,toolCallId,status) being passed through the OpenAI streaming validator, with the exact same error structure and the same suggested fix of filtering or routing these messages separately.github-actions commentedon Sep 10, 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.