Skip to content

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

Closed

Description

@Seeken-dai

环境: 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 行。

Activity

  1. github-actions commented on Sep 8, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    If your issue is distinct (e.g. specific to Windows or to the UI state not resetting after abort), please add a comment explaining what differs from those reports.

  2. neriousy commented on Oct 20, 2026

    @neriousy
    Member

    Thanks for the report! In 2.0.29, large writes cut off by the model's output limit leave the writing state and report the cause, the model is told to split the payload into smaller calls, and repeated output-limit continuations are capped. Update with opencode upgrade or npm i -g @opencode/cli@latest (desktop: update the app). Please reopen or comment if this still happens on that version.

    感谢反馈!在 2.0.29 中,因模型输出长度限制而未完成的大文件写入会退出“正在写入”状态并说明原因,模型会收到拆分为较小调用的提示,连续触及输出限制的续写次数也有了上限。请运行 opencode upgrade 或 npm i -g @opencode/cli@latest 更新(桌面版请更新应用)。如果在该版本上仍然遇到此问题,请重新打开此 issue 或留言。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions