opencode 缺陷:read 丢缩进致 agent 弃用专用工具改用 shell
nimao33 · ghdev · 2026-10-11
- opencode v2.0.26 在 Windows 上被曝一个影响 agent 行为的缺陷:read 工具返回的内容会丢失行首缩进(大文件尤其明显),而 edit/write 又要求 oldString 与文件字节级精确匹配(含空白与换行符)。
- 结果是 agent 无法信任 read 的输出做编辑,edit 频繁报 oldString must byte-match 类错误,最终放弃专用文件工具,退回用 bash/PowerShell 的 cat、Get-Content、Set-Content、重定向等 shell 方式读写文件。
- 报告者建议:read 应忠实返回缩进或明确文档化归一化规则;edit 应支持空白模糊匹配,或失败时返回有用的 diff 说明不匹配之处,让 agent 留在专用工具上。该 issue 已有 7 条评论,处于待关闭/分诊状态。
「编程与Agent」频道最新
- Decisions API 正式 GA,agent 反馈循环全自动剪辑云视频 — dkundel · 2026-10-23
- 50+ 免费 AI Agent 学习资源合集:视频与仓库一站打包 — ifioknkem · 2026-10-23
- 自封「全网最佳」的免费 AI Agent 资源库引围观 — ifioknkem · 2026-10-23
- Vercel 推出免注册部署:拖拽文件到首页即得线上 URL — steren · 2026-10-23
- 5 个 Claude Code 会话经 MCP 互发邮件,组队攻破多品牌网络摄像头 — doodlestein · 2026-10-23
- Vercel 上线 vercel deploy --temporary,可临时部署后自动清理 — cramforce · 2026-10-23