Skip to content

Z.AI GLM-4.7 cannot read images from Read tool (model supports vision) #13310

Closed

Description

@Llegion404

Bug Description

GLM-4.7 is a multimodal model with vision support, but when using the Read tool to read image files with Z.AI (zai-coding-plan), the model says "I cannot read the image".

Expected Behavior

The model should be able to read and analyze image content, similar to how Claude, GPT-4, and other vision-capable models work.

Actual Behavior

When asking GLM-4.7 to read an image file using the Read tool:

  • Error message: "Cannot read "/path/to/image.jpg" (this model does not support image input). Inform the user."
  • Pasting images directly in messages works fine
  • GLM-4.7 itself supports vision (can read images in other contexts)

Root Cause

The `supportsMediaInToolResults` function in `packages/opencode/src/session/message-v2.ts` doesn't include `@ai-sdk/openai-compatible` (used by Z.AI).

Current supported SDKs:

  • `@ai-sdk/anthropic`
  • `@ai-sdk/openai`
  • `@ai-sdk/amazon-bedrock`
  • `@ai-sdk/google-vertex/anthropic`
  • `@ai-sdk/google` (Gemini-3 only)

Suggested Fix

Add `@ai-sdk/openai-compatible` to the `supportsMediaInToolResults` list:

```typescript
if (model.api.npm === "@ai-sdk/openai-compatible") {
// Z.AI GLM models support vision
return true
}
```

Related Issues

Environment

  • OpenCode version: 1.1.60
  • Provider: Z.AI (GLM Coding Plan)
  • Model: GLM-4.7

Activity

  1. kassieclaire commented on Feb 16, 2026

    @kassieclaire

    GLM-4.7 is text-only, as described here:

    Image
  2. github-actions commented on Apr 17, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions