OpenCode 会话被污染 bug:Responses 端点注入 system 消息后 400 卡死

thystips · ghdev · 2026-10-14

事件

OpenCode V2(v2.0.28/2.0.29)存在一个核心 bug:当会话中途发生指令或工具源变更时,核心模块(如 core/instructions、core/mcp-guidance 等)会按设计向历史中追加一条 system 通知消息。若该通知恰好紧跟在一条以 tool output 结尾的 assistant 消息之后,OpenAI 兼容的 Responses 端点会拒绝整个请求,返回 400 错误:

> "A tool output cannot be combined with new developer or system context."

后果

复现环境

该 issue 目前有 6 条讨论,对使用 Responses API 的编码 agent 用户是重要踩坑提示。

原文链接 →

「编程与Agent」频道最新

更多「编程与Agent」频道 AI 资讯 →