anomalyco / anomalyco/opencode

超大 Write 会中止,界面停在「正在写入」;模型失败后循环规划而不降级

Open
#47,868 1 comment 0 reactions 1 assignee View on GitHub

@rekram1-node is already working on this.

Since Sep 8, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

环境: Windows

现象

一次 Write 写入约 1500–2500 行单文件(HTML)时,工具返回 Tool execution aborted,目标目录仍为空。
UI 长时间停在「正在写入」,会话看起来像卡死或循环。
中止后模型在思考里反复重写整份文件,再次发起超大 Write,偶发空 Write(无 path/content)。
同会话中较小文件(约 300 行 Markdown)的 Write 成功,说明不是「完全不能写」。
复现(匿名)

让 agent 生成一份 1500+ 行、无外部依赖的单文件 HTML 原型。
模型用单次 Write 提交全文。
观察:abort、目录无文件、界面停在写入中。
继续同一会话:模型不改成分段写入,重复规划/重试。
根因判断(建议分开记)

Harness: 单次 Write 的 XML 载荷/超时扛不住超大文本;中止后前端状态未从「正在写入」收回。
模型: abort 后未改成「先写骨架,再 400–600 行分段 Edit」;把工具失败当成「再想一遍完整内容」。
期望

超大 Write 应失败得干净:明确错误(payload too large / timeout),不要卡在「正在写入」。
对 agent 可见的错误信息里带「请拆分写入」类提示。
可选:超大内容自动分块,或硬限制并在调用前拒绝。
变通(当前可用) 先写 200 行骨架,再按块 Edit 追加;单次控制在约 400–600 行。

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.