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
Image detail parameter missing in OpenAI-compatible provider image payloads #24242
When sending images to custom OpenAI-compatible providers (e.g., Z.AI GLM 5.1), the detail field is not included in the image_url object. The current payload looks like:
Without detail, some providers default to "low", which heavily downscales the image. The model receives the image without error but can barely interpret its contents.
Expected behavior
The payload should include a detail field, defaulting to "high" or "auto":
Ideally this would also be configurable per-model in opencode.json (e.g., an image_detail option).
Location
internal/llm/provider/openai.go — where ChatCompletionContentPartImageImageURLParam is constructed. Only the URL field is set; Detail is omitted.
Note: the ImageURLContent struct in internal/message/content.go already has a Detail field, but it's never used in the OpenAI provider's convertMessages().
Reproduction
Configure a custom provider using @ai-sdk/openai-compatible (e.g., Z.AI GLM 5.1)
Attach an image in a conversation
The model accepts the image but gives vague or incorrect descriptions — consistent with receiving a low-resolution thumbnail
Activity
github-actions commentedon Jul 4, 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.