zai-org / zai-org/zcode-plugins
【功能请求】glm 系模型 OpenAI 兼容通道的图片输入被客户端强制丢弃...
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 39
- Forks
- 20
- PR merge metrics
- No merged PRs in 30d
Description
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.]
图片在客户端本地即被丢弃,请求体中不含任何图片字段(与中转站网关无关)。
复现步骤
- 模型设置 → 添加供应商 → Base URL 填 OpenAI 兼容中转地址,API 格式选
Chat Completions - 添加模型
glm-5.3-flash - 聊天中粘贴一张图片发送
- 看到上述占位提示;而同通道的
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),但最终判定仍被兜底覆盖,配置无法生效。
期望
- 自定义模型支持按模型声明媒体能力(
supportsImages/modalities.input),并在模型设置 UI 中提供开关 - 能力解析优先尊重用户配置;兜底策略不再对
openai-chat-completions+ glm 组合一刀切
影响
通过中转或自建 OpenAI 兼容端点使用 GLM 多模态能力的用户完全无法发图,而模型与通道本身都支持。目前只能本地 patch 客户端文件绕过,希望官方原生支持。
若本仓库仅用于插件市场、并非客户端反馈渠道,烦请告知正确的反馈入口,谢谢!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with resources/glm/zcode.cjs, tracing lia(e,t) for capability resolution and Y1(e,t) for image serialization. Check how ~/.zcode/cli/config.json modelCatalog.overrides and the model settings UI feed those values. Done means configured image capability is honored for OpenAI-compatible GLM models, images are retained in the request, and the existing fallback no longer overrides the user setting.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- api, frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100