[Bug] Magpie 单个模型缺少 modalities.input 导致所有 Provider 验证失败
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 56/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
Research direction
Start with apps/cli/src/agent/magpie-runtime.ts, especially modelSchema, readMagpieModels(), and the prepareMagpieRuntime() path. Reproduce the reported schema failure with the minimal catalog in the issue, then inspect downstream modalities?.input.includes('image') uses before changing how missing input is handled. Done means mixed catalogs with missing modalities, output-only modalities, and explicit text or image input are handled safely, with regression coverage preserving model ID and size validation.
Written by the indexing model from the issue text.
Description
Affected area
Agent runtime / ACP
Installation method
Desktop release
Lody version or commit
0.108.1
Operating system
macOS 27.0.1 arm64
Agent or runtime
Magpie 0.1.1725;通过 Magpie 导入的内置 Claude、Codex、Pi、Kimi、Grok Provider。
What happened?
导入 Magpie 后,设置 → Agents 中的 Claude-magpie、Codex-magpie、Pi-magpie、Kimi Code-magpie、Grok-magpie 均显示「Provider 验证失败,请重试。」;重试仍失败。
只读检查本地网关:
GET /api/hello:HTTP 200,name: "magpie"。GET /v1/models:HTTP 200,返回 91 个模型,没有重复 ID。- 第 81 个模型
commandcode-plan/zai-org/GLM-5.3的modalities只有output: ["text"],没有input。 - Lody 对整份目录执行 schema 校验,因此单个模型缺少能力元数据会阻断全部 Magpie Provider 的准备流程。
What did you expect?
缺少可选能力描述时,Lody 应能采用保守的既有回退行为,或明确处理受影响的模型,避免让无关的有效模型和所有 Magpie Provider 一起无法使用。
至少应在诊断中保留具体模型和字段,而非把非空目录统一提示为 invalid or empty。
How can we reproduce it?
- 启动 Magpie,并选择 Command Code Plan 下的
zai-org/GLM-5.3。在上述版本的现用环境中,该模型出现在/v1/models,但只返回modalities.output。 - 通过 Magpie 导入 Lody 的多个内置 Provider。
- 打开 Lody → 设置 → Agents,观察所有导入的 Provider 验证失败;点击「重试」仍失败。
- 检查日志中的
Magpie returned an invalid or empty model catalog。
模型对象中触发问题的字段摘录:
{
"id": "commandcode-plan/zai-org/GLM-5.3",
"display_name": "GLM-5.3",
"modalities": {
"output": ["text"]
}
}
维护者也可为 readMagpieModels() 注入 fetcher:让 /api/hello 返回 {"name":"magpie"},让 /v1/models 返回下面的最小目录,即可触发同一 schema 条件,无需真实账号或推理请求:
{
"object": "list",
"data": [
{
"id": "example-text-model",
"modalities": { "input": ["text"] }
},
{
"id": "example-output-only-model",
"modalities": { "output": ["text"] }
}
]
}
How often does it happen?
Every time
相同目录下,现有日志中的多次准备/重试均失败;对捕获目录的隔离 schema 校验稳定复现。未跨机器复测。
Relevant log output
以下摘录移除了工作区标识和其他无关信息:
[acp-capabilities] Refresh failed (cliType=builtin agentType=claude): Magpie returned an invalid or empty model catalog
[acp-capabilities] Refresh failed (cliType=builtin agentType=codex): Magpie returned an invalid or empty model catalog
[acp-capabilities] Refresh failed (cliType=builtin agentType=pi): Magpie returned an invalid or empty model catalog
[acp-capabilities] Refresh failed (cliType=builtin agentType=kimi): Magpie returned an invalid or empty model catalog
[acp-capabilities] Refresh failed (cliType=builtin agentType=grok): Magpie returned an invalid or empty model catalog
隔离校验给出的具体错误:
{
"expected": "array",
"code": "invalid_type",
"path": ["data", 80, "modalities", "input"],
"message": "Invalid input: expected array, received undefined"
}
Additional context
源码定位
检查 0.108.1 安装包的 resources/cli/index.js,并对照检查时的公开 main(固定在 66c9d019046951b3222ef75ee9ca321d25b011c5),两者具有相同逻辑:
- modelSchema / catalogSchema:整个
modalities可以缺省,但一旦存在,其input就是必填数组。 - readMagpieModels:整份目录一次性
safeParse,任意一项失败便抛出通用错误。 - prepareMagpieRuntime:所有支持的 Magpie runtime 都先读取并校验相同目录。
上述 main commit 用于定位公开源码,不作为 0.108.1 的精确构建 commit。
已执行的对照验证
从安装包提取该 schema 定义,配合安装包内的 Zod,对实际捕获的 91 项响应进行隔离校验:
| 输入 | 结果 |
|---|---|
| 原始响应,91 项 | 失败,唯一错误为 data[80].modalities.input 缺失 |
仅为该项补上 input: ["text"],仍为 91 项 |
通过 |
| 仅移除该项,剩余 90 项 | 通过 |
这只证明模型目录校验的触发条件;没有修改实际网关、安装包或用户配置,也没有构建 main、部署修复或验证真实对话调用。
兼容性背景与修复方向
OpenAI 的模型列表接口定义没有要求 modalities.input;这是扩展元数据。这里只报告 Lody 对缺省扩展字段的处理及失败影响范围,不据此断言双方是否另有私有协议约定。
建议兼容缺少 input 的情况,并沿用明确、保守的能力回退;保留模型 ID、大小上限等边界校验。若改为允许 input 缺省,还需一起处理下游多处 m.modalities?.input.includes('image'),否则会将验证失败变成运行时异常。回归用例应覆盖「整个 modalities 缺省」「只有 output」「显式 text/image input」及多个模型混合的目录。
Before submitting
- I searched the existing issues and did not find a duplicate.
- This report concerns an open-source component in this repository, not a hosted service, Web or mobile app, account, or billing issue.
- This is not a security vulnerability; security reports follow the repository's security policy.
- I removed credentials, private source, conversations, prompts, personal data, and other sensitive information.
- Dominant language
- TypeScript
- Stars
- 1.2k
- Forks
- 141
- Avg merge
- 13h 8m
- Merged PRs (30d)
- 657
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
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.
More from LodyAI/Lody
-
[Feature Request] Default macOS UI text to SF Pro Display with native font smoothingPossibly taken @Innei claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
[Bug] Opening a PDF in the file preview crashes with "The container must be absolutely positioned"Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
LodyAI/Lody#1141 · 1 comment ·
Maintainers usually reply within 1 day
-
[Bug] Chat landing machine picker stays loading until full doc-meta scanMay be free again A pull request for this issue was closed without being merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
[Bug] Task lifecycle progress never reaches history, so the panel cannot show the running toolMay be free again A pull request for this issue was closed without being merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
area:desktop area:ui bug platform:macos
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
anthropics/claude-code#106183 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 1/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
core: OpenRouter BYOK sessions record cost = 0 since v2.2.0 (ignores cost_details.upstream_inference_cost)Possibly taken A pull request linked to this issue is open or already merged. Openreproduced
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
anomalyco/opencode#60558 · 1 comment ·
Maintainers usually reply within 1 day