Web UI 停止按钮无法真正打断回合:仅中止当前 step,skill_activation 重放续跑,用户消息排队 ~10 分钟且送达后重复注入(2.0.2 回归)
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- bash, javascript, shell, typescript
- Ambito
- backend, cli, developer-experience, tooling
Direzione di ricerca
Look at the turn cancellation logic in the Web UI and server, focusing on how skill_activation prompts are replayed. Examine the wire logs for turn.cancel events and the subsequent turn creation. Check the message queueing mechanism in the prompt submission flow. The goal is to ensure a stop button cancels the entire turn and its tool calls, not just the current step, and that queued messages are handled correctly without duplication.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
你运行的 Kimi Code 版本是?
2.0.2(上一个版本为 0.4.x,具体小版本不记得了)
你使用的客户端是?
Kimi TUI 中通过 /web 启动的 Web UI,浏览器为 Chrome(非终端直开的 TUI 界面)
你使用的是哪个开放平台/订阅?
第三方自建网关(公司内部 OpenAI 兼容接口,非官方订阅)
你使用的是哪个模型?
kimi-k3
你的电脑平台是?
macOS (Darwin 27.0.0 arm64)
你遇到了什么问题?
长任务执行期间,回合(turn)几乎无法被用户打断,共观察到四个相互关联的问题(回归:在 Web UI(/web,Chrome)中,停止按钮在此前的版本(0.4.x)中可正常打断回合,2026-09-23 自动更新到 2.0.2 后失效):
- 回合运行中发送的用户消息不会打断当前回合,而是被静默排队。 我在 agent 操作浏览器执行发布流程时,于 14:42:57 发送「停 发git tag 别折腾master」,server 事件记录为
prompt.submitted status=queued;14:44:37 再发一条,同样入队。两条消息分别等了约 10 分钟,直到回合自然结束后才被执行。期间 agent 完全看不到「停」,继续完成了 33 步操作。 - Web UI 的停止按钮只中止当前 step,不打断整个任务。 14:42:41.377 wire 记录了
turn.cancel (reason: user_cancelled),当前 step 以finishReason: interrupted结束——但约 3ms 后,框架把挂起的skill_activationprompt 重放为一个新的 turn.prompt(内容是一整段<skill-loaded name="application-deploy" ...>,origin 为 skill_activation),随即开启 turn 2。agent 毫无停顿地继续同一发布流程又跑了 10 分钟。 - 在途的工具调用(含浏览器操作)不受停止影响。 本次浏览器操作是通过内置浏览器桥接(kimi-webbridge:本地 HTTP 服务,由 Bash
curl驱动 navigate/click/fill/snapshot 等 action)完成的。按停止后,后续 33 步浏览器操作(点击发起构建、定位发布页、确认发布、推进部署单等)全部继续执行完毕——框架无法取消正在运行的 Bash 工具调用,用户没有任何有效的紧急停止手段。 - 排队消息送达后被双重注入,UI 出现复读/重复气泡。 同一条排队消息(promptId
msg_01M36G4N7...)在 wire 里被追加了两遍:先作为agent.message.appended(user 消息,14:54:00.865),同毫秒又作为turn.prompt+context.append_message(14:54:00.868/.869)。UI 上「不是你在干嘛」渲染了两个一模一样的用户气泡(截图可见 14:53、14:54 各一个)。同时框架注入了一条origin: {kind: injection, variant: interruption}的 system-reminder,声称「previous turn was interrupted by the user before completion; any partial output shown above is incomplete」——但实际上任务无缝继续到了完成。而当排队 ~10 分钟的「停」终于被执行时,工作早已做完,模型只能回一段对已完成操作的长篇复述(recap),「停止」的语义彻底丢失。
复现步骤?
- 让 agent 执行一个长任务链:后台任务通知触发 → 模型调用 Skill → 通过内置浏览器桥接(kimi-webbridge)在网页上执行多步发布操作(本次:单回合 33 步、约 10 分钟,每步为
curl 本地 webbridge的 Bash 调用)。 - 回合运行中点击 Web UI 停止按钮:观察到 wire 记录
turn.cancel (reason: user_cancelled)+ 当前 stepinterrupted,但挂起的 skill_activation 被重放为新 turn,任务继续。 - 回合运行中再发送用户消息(如「停」):观察到 server 事件
prompt.submitted status: queued,消息直到回合结束才执行;且同一 promptId 被agent.message.appended和context.append_message各追加一次,UI 渲染出重复气泡。 - 关键事件时间线(本地时间 UTC+8,来自 wire.jsonl 与
~/.kimi-code/server/events/<session>.jsonl):
| 时间 | 事件 |
|---|---|
| 14:37:09 | 用户初始 prompt(turn 0):挂 IM 群监听,有发版需求用 deploy skill 处理 |
| 14:38:27 | 后台任务完成通知触发 turn 1(origin: task),模型调用 Skill |
| 14:38:52–14:42:30 | turn 1 执行发布流程 20 步 |
| 14:42:41.377 | turn.cancel turnId=1 reason=user_cancelled(用户点击 Web UI 停止按钮) |
| 14:42:41.385–.389 | step 20 finishReason=interrupted;随即 turn 2 以 origin=skill_activation 启动,任务无缝继续 |
| 14:42:57.764 | prompt.submitted status=queued「停 发git tag 别折腾master」——入队 |
| 14:44:37.256 | prompt.submitted status=queued「不是你在干嘛」——入队 |
| 14:42:41–14:53:01 | turn 2 继续执行 33 步浏览器操作,全程无打断点 |
| 14:53:01.208 | turn.ended turn 2 reason=completed (durationMs=619820) |
| 14:53:01.210 | 排队 10 分钟的「停」才作为 turn 3 执行,模型只能复述已完成工作 |
| 14:54:00.865/.868 | 「不是你在干嘛」同一 promptId 被两次追加(复读气泡) |
完整 wire.jsonl / server events 可应要求私下提供(内含内部标识符,不便直接贴出)。
期望的行为是什么?
- Web UI 的停止按钮应终止整个当前回合:取消在途工具调用(含 Bash/MCP/浏览器桥接)、丢弃模型已发出但尚未执行的工具调用,而不是只杀当前 step 后把挂起 prompt 重放进新回合继续跑。
- 回合运行中发送用户消息,应提供「打断当前回合并立即处理」的语义(或至少明确提示消息已排队、且排队状态对用户可见)。
- 排队消息送达后只应注入一次;取消时注入的 interruption 元数据应与实际行为一致(任务实际继续时不应声称 previous turn was interrupted、partial output incomplete)。
补充信息
- 回归确认:上一个版本为 0.4.x(具体小版本不详),当时 Web UI 的停止按钮可正常打断回合;2026-09-23 自动更新到 2.0.2 后出现本 issue 描述的行为(基于用户体验确认,无旧版本 wire 佐证)。
- 客户端为 TUI 中
/web启动的 Web UI(Chrome 浏览器)。可能与 #2827(VSCode 插件要求停止无效)、#2949(无打断按钮)相关,但本 issue 针对 Web UI 2.0.2 的回合级打断语义,根因链(step 级 abort → skill_activation 重放 → prompt 排队至回合结束 → 重复注入)未见于现有 issue。 - 权限模式为 auto,无 approval 拦截,agent 全程自动执行。安全影响:对发布/部署这类变更生产系统的长任务,用户没有任何有效的紧急停止手段。
- Lingua principale
- TypeScript
- Stelle
- 8k
- Fork
- 1.3k
- Merge medio
- 17h 52m
- PR unite (30g)
- 163
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di MoonshotAI/kimi-code
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
MoonshotAI/kimi-code#4548 ·
I maintainer di solito rispondono entro 1 giorno
-
VS Code extension: clickable file links in chat drop the :line suffix, never jump to the lineForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
MoonshotAI/kimi-code#4398 ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug] vis reports legacy tool-triggered swarm sessions as activeForse già presa @louisss1016 l’ha presa 4 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
MoonshotAI/kimi-code#4395 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
MoonshotAI/kimi-code#4392 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
MoonshotAI/kimi-code#4381 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di MoonshotAI/kimi-code
Issue simili
-
area:cli bug P4
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
bug from-studio
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
esengine/DeepSeek-Reasonix#14868 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
linxiv-dev/linXiv#384 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
scope:core type:security
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
follow-redirects updateAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
mailgun/mailgun.js#544 ·