[Bug] 视频附件进入会话历史后每轮重发,持续触发 GLM 1210「视频数超限」——建议 consume-once / 占位符替代
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 22
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
提交前确认 · Pre-submission checklist
- 我已搜索过现有 issue,确认这不是重复 / I searched existing issues and confirmed this isn't a duplicate.
- 我已阅读 CONTRIBUTING.md / I've read CONTRIBUTING.md.
问题类别 · Category
其他 · Context management(视频附件的上下文生命周期)
涉及的 Agent 框架 · Agent framework
ZCode Agent(自研)
严重程度 · Severity
阻塞使用 · Blocking(触发后该会话永久无法继续,只能新开会话 / the session becomes permanently unusable, must start a new one)
复现频率 · Reproducibility
必现 · Always
问题描述 · Description
视频附件一旦进入会话历史,ZCode 在后续每一轮请求中都会把完整视频重新发送给模型 API,持续触发 GLM 错误码 1210「The number of input videos exceeds the limit」(retryable=false)。模型明明已经成功看过一遍视频并正常回复,但从下一轮开始所有请求都失败,会话彻底卡死。
与 #81 不同:本例是视频输入个数超限,不是 MCP 工具过多导致的 Invalid API parameter。
In English: Once a video attachment enters the conversation history, ZCode re-sends the full video bytes to the model API on every subsequent turn. GLM rejects each request with error 1210 "The number of input videos exceeds the limit" (retryable=false), so the session is permanently broken even though the model already consumed the video successfully in the first turn. Suggested fix: consume-once — after the model has processed an attachment, replace it in subsequent request payloads with a placeholder + the model's earlier observations, and re-read the file from disk on demand (the artifact path is already persisted).
复现步骤 · Steps to reproduce
- 在 ZCode 3.9.2(macOS)新会话中使用内置
builtin:bigmodel-coding-plan,模型 GLM-5.3-Flash。 - 附上一个 mp4 视频并发送任意提问(例如做渲染结果 QA)。
- 第一轮正常:模型成功读取视频并给出分析回复。
- 发送任意后续追问(哪怕只是「谢谢」)。
- 该轮直接失败:错误 1210 "The number of input videos exceeds the limit",
retryable=false,此后每一轮都复现,无法在该会话内恢复。
期望表现 · Expected behavior
- 视频被模型消费过一次后,后续请求的历史中应以占位符(+ 该轮已产出的文本结论)替代原始视频字节;需要回看时由 Agent 按文件路径重新读取一次。
- 至少应在发送前检测到「历史中的视频数超过模型上限」并自动降级(剔除最早的视频 / 提示用户),而不是让每轮请求必然 4xx。
实际表现 · Actual behavior
LLM API 无状态,ZCode 每轮全量重发历史,视频字节原样保留在每个请求里;只要历史中带过视频,后续所有请求持续被 provider 以 1210 拒绝,且 retryable=false,重试与新提问均无效,只能放弃整个会话。
ZCode 版本 · ZCode version
3.9.2.6069
设备 / 系统 / 浏览器 · Device / OS / Browser
macOS 26 (darwin 25.5.0) arm64;provider builtin:bigmodel-coding-plan;model GLM-5.3-Flash。
截图 / 录屏 / 日志 · Screenshots / Recordings / Logs
[1210][The number of input videos exceeds the limit][20260828021733ae7d295004ab41c9]
TraceID: c9729252-87a5-4ae8-8bd2-4aad6e3480ca
Turn execution failed
provider=builtin:bigmodel-coding-plan provider_code=1210 model=GLM-5.3-Flash request=701171a3-c01c-4446-84bc-fea3c1fefe9b reason=unknown retryable=false
触发场景:本地渲染管线产出的 mp4 对比动画贴入会话做 QA。同会话第二轮起 100% 复现。
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
Reproduce the failure with an mp4 in ZCode 3.9.2 using builtin:bigmodel-coding-plan and GLM-5.3-Flash, then trace conversation-history serialization and provider request construction. Done means a consumed video is not resent on every later turn, later requests remain usable, and the input-video limit is handled without recurring error 1210.
Written by the indexing model from the issue text.
Assessment
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100