[PR #4715] fix(write): support array content from Venice.ai models #11080

Closed
opened 2026-02-16 18:15:52 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/4715

State: closed
Merged: No


Some AI models (e.g., GLM 4.6, Qwen 3 Coder 480B) send tool call content as arrays instead of strings. This causes the write tool to fail with: 'Invalid input: expected string, received array'

This fix uses Zod's preprocess function to handle both formats:

  • String content: passed through unchanged
  • Array content: joined with newlines
  • Other types: converted to string

This maintains backward compatibility while enabling support for Venice.ai and similar models that use array-based content formatting.

Related: https://github.com/charmbracelet/crush/pull/1508

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/4715 **State:** closed **Merged:** No --- Some AI models (e.g., GLM 4.6, Qwen 3 Coder 480B) send tool call content as arrays instead of strings. This causes the write tool to fail with: 'Invalid input: expected string, received array' This fix uses Zod's preprocess function to handle both formats: - String content: passed through unchanged - Array content: joined with newlines - Other types: converted to string This maintains backward compatibility while enabling support for Venice.ai and similar models that use array-based content formatting. Related: https://github.com/charmbracelet/crush/pull/1508
yindo added the pull-request label 2026-02-16 18:15:52 -05:00
yindo closed this issue 2026-02-16 18:15:52 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#11080