Skip to content

【功能请求】glm 系模型 OpenAI 兼容通道的图片输入被客户端强制丢弃... #2

Description

@xiazhiaidao

Issue 草稿:提交到 zai-org/zcode-plugins

提交地址(点击后标题和正文已预填,确认无误后点 Submit):
issue-url.txt


标题

【功能请求】glm 系模型 + OpenAI 兼容通道的图片输入被客户端强制丢弃,请开放按模型配置媒体能力

正文

环境

  • ZCode Desktop 3.7.6,Windows x64
  • 自定义供应商:Base URL https://<中转站>/v1,API 格式 Chat Completions (/chat/completions)
  • 模型:glm-5.3 / glm-5.3-flash(模型页标注支持图像,中转端可正常转发图片)

现象

聊天中粘贴任何图片,模型收到的内容被替换为:

[Media omitted from provider request because the selected model does not support image input.]

图片在客户端本地即被丢弃,请求体中不含任何图片字段(与中转站网关无关)。

复现步骤

  1. 模型设置 → 添加供应商 → Base URL 填 OpenAI 兼容中转地址,API 格式选 Chat Completions
  2. 添加模型 glm-5.3-flash
  3. 聊天中粘贴一张图片发送
  4. 看到上述占位提示;而同通道的 deepseek-v4-pro 可正常识图

源码定位(resources/glm/zcode.cjs,3.7.6)

模型能力解析链为:modelCatalog.overrides → models.dev 目录 → 内置补丁表 → 兜底策略。对 glm 系模型:

  • 内置补丁表中无 glm 图片规则(仅 deepseek-v4-pro 等被允许)
  • 兜底策略一刀切:
function lia(e,t){
  if(e.supportsImages===void 0&&pia(t.modelId)){
    if(t.apiFormat==="openai-chat-completions"){ e.supportsImages=!1; return }  // ← 强制判死
    ...
  }
}
  • 序列化层据判定结果把 image 部件替换为占位文字:
function Y1(e,t){ if(e.type==="image"&&t?.supportsImages===!1) return"image input"; ... }

另外:用户级 modelCatalog.overrides~/.zcode/cli/config.json)确认会被加载(启动日志 configSourceUser=true),但最终判定仍被兜底覆盖,配置无法生效。

期望

  1. 自定义模型支持按模型声明媒体能力(supportsImages / modalities.input),并在模型设置 UI 中提供开关
  2. 能力解析优先尊重用户配置;兜底策略不再对 openai-chat-completions + glm 组合一刀切

影响

通过中转或自建 OpenAI 兼容端点使用 GLM 多模态能力的用户完全无法发图,而模型与通道本身都支持。目前只能本地 patch 客户端文件绕过,希望官方原生支持。

若本仓库仅用于插件市场、并非客户端反馈渠道,烦请告知正确的反馈入口,谢谢!

Activity

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

Metadata

Metadata

Assignees

No one assigned

    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