Quitting an in-process chat silently strands its running task
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 52/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- go
- 领域
- backend, cli, documentation, testing
调研方向
Start with internal/session/task_run_belt.go at cutBeltRun and driveBeltRun, then reproduce the scripted RunEngine scenario described in the issue, including the done-during-close race. Read internal/manual/chat/worker-harness.md:523 for the current promise. Done means the in-process close behavior is explicit and ordered, the e2e and unit acceptance cases pass, and the manual plus change entry are updated.
由索引模型根据 Issue 内容生成。
描述
Found on santos/dev2 at 008363c98 (#1410). It reaches dev when #1410 merges.
What happened
On 2026-09-24, /quit during a /task in codeaf chat --no-host closed the window without warning. The run later read interrupted; its file never landed, and its branch and copy remained. worker-harness.md says closing the window, ctrl+c and /quit do not stop a run and its work lands by itself. The engine road did land in the control run. Related design: #1318.
Replication
Deterministic (no model). In internal/session, use a scripted RunEngine whose worker waits on a channel. Start a belt run, call Agent.Close, release the worker, and inspect the root and target Git tree. Today the close cancels the driver and the non-done result takes the interruption return without landing.
Field (real models). With OPENROUTER_API_KEY, deepseek/deepseek-v4-flash and a throwaway Git repository, ask /task run sleep 45, then write done.txt containing done; while it runs, enter /quit. Allow about two minutes and a few cents. Reopen: done.txt is absent and the run is interrupted. Repeat on the engine road as a control.
Where
internal/session/task_run_belt.go:744, cutBeltRun, cancels the run; driveBeltRun at :795 returns without landing when closing. The unqualified manual promise is internal/manual/chat/worker-harness.md:523.
The fix
Make the close behavior explicit on the in-process road: keep the run alive through an owner able to finish it, or warn before quitting that the run will be interrupted. Make the manual precise for both roads.
Suspicion, not reproduced
From reading the code, not reproduced: Agent.Close cancels the run but never waits on run.over. A run answering done during close may merge into the person's checkout after Close returns. A hand test pressing /quit as the final leaf finishes, plus a session test whose RunEngine.Start answers done just after cancellation and asserts run.over closed before Close returns, would settle this.
Acceptance
- e2e:
codeaf chat --no-hostgives the chosen explicit close warning or completes landing; the run, file and branch match its words. - Unit: close and driver completion have a defined ordering, including the done-during-close race.
- Update
worker-harness.mdand a change entry'sinvalidates.
- 主要语言
- Go
- 星标
- 115
- 派生
- 14
- 平均合并
- 9 小时 38 分钟
- 30 天内合并 PR
- 749
环境准备
我们还没有检查这个项目的环境配置文件。先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Agent-Field/CodeAF 的其他 Issue
-
area:chat feature
难度 2/5 1-3 小时 新手友好度 88/100
Agent-Field/CodeAF#1510 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
Agent-Field/CodeAF#1489 ·
维护者通常 1 天内回复
-
area:chat bug good first issue sev:papercut
难度 2/5 1-3 小时 新手友好度 78/100
Agent-Field/CodeAF#1470 ·
维护者通常 1 天内回复
-
area:chat bug good first issue sev:papercut
难度 2/5 1-3 小时 新手友好度 85/100
Agent-Field/CodeAF#1469 ·
维护者通常 1 天内回复
-
area:chat bug sev:papercut
难度 2/5 1-3 小时 新手友好度 88/100
Agent-Field/CodeAF#1468 ·
维护者通常 1 天内回复
查看 Agent-Field/CodeAF 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 92/100
GoogleCloudPlatform/k8s-config-connector#13462 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
microsoft/TypeScript#64453 ·
维护者通常 1 天内回复
-
OpenAI-compatible endpoint: response ids have only 999 possible values (chatcmpl-rand.Intn(999))未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复