opencode 修复 GPT-6.2 缓存 bug,每步未缓存输入从 1.4 万 token 降至 3

victor_explore · x · 2026-11-19

opencode 发布 v2.3.2,修复一个影响所有 GPT-6.2 用户的计费问题:GPT-6.2 模型不会缓存经 Responses 接口 instructions 字段传入的 system prompt,导致 agent 每一步都把系统提示词按未缓存输入重新计费。

修复方式:opencode 现在把 system prompt 作为开头的 developer message 发送,覆盖 OpenAI(API key 与 ChatGPT 登录)、GitHub Copilot、Zen、Azure 和 OpenRouter 所有 Responses 路由,从第二步起即可命中缓存;/responses/compact 压缩也读取同一缓存前缀。

效果:在 GitHub Copilot 的 gpt-6.2-sol 上,每步未缓存输入从约 14,000 tokens 降至 3 tokens。另修复 webfetch structured output 重复传入 url 和 format 的问题。

对自建 agent 的人是个值得注意的坑:用 Responses 接口时 system prompt 的传入字段直接决定缓存是否生效。

原文链接 →

「编程与Agent」频道最新

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