Archive note, July 2026: This repository is now read-only. The npm package was never published; the article is retained as a record of the final source implementation.The annoying thing about long agent sessions is that the expensive failures are often tiny. A model does not need to misunderstand the task to break the run. It only has to stringify one nested field, flatten one array, or ask the same question again while the user is still answering.opencode-plugin-fixes started as a small source bundle for those edges. Its final source tree added a fourth guardrail: FixDcpCompressFlat.
What changed
- FixQuestionSchema repairs malformed question tool arguments.
- FixMcpNestedObject parses only selected MCP schema fields, leaving file content untouched.
- FixDcpCompressFlat restores DCP compress range payloads when a model preserves the data but breaks the nested array shape.
- BlockRepeatQuestion prevents repeated prompt spam before the user replies.
Json
{
"topic": "Session summary",
"content": [
{
"startId": "m0001",
"endId": "m0008",
"summary": "..."
}
]
}
Why it belongs in the family
Historical status
2026 年 7 月归档说明: 本仓库现已只读。npm 包从未发布;本文仅作为最终源码实现的历史记录保留。长上下文 agent 会话最烦人的地方是:真正昂贵的失败,往往不是模型完全不懂任务,而是一个很小的工具参数形状坏了。比如某个 nested field 被字符串化,某个 array 被 flatten,或者用户还没回答完,模型就根据 (no answer) 又问了一遍。opencode-plugin-fixes 本来就是为这些边缘情况做的小型源码合集。最终源码加入了第四个护栏:FixDcpCompressFlat。
这次更新了什么
- FixQuestionSchema 修 question 工具参数形状。
- FixMcpNestedObject 只解析少数 MCP schema 字段,不碰文件正文。
- FixDcpCompressFlat 在模型保留了信息、但打坏 DCP compress nested array 形状时,把参数还原回来。
- BlockRepeatQuestion 防止用户还没回答完时模型反复追问。
Json
{
"topic": "Session summary",
"content": [
{
"startId": "m0001",
"endId": "m0008",
"summary": "..."
}
]
}