MoonshotAI / MoonshotAI/kimi-code
[web] 后台任务完成通知在对话流中钉死在底部,后续模型输出渲染在其上方
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 7.5k
- Forks
- 1.2k
- Avg merge
- 11h 53m
- Merged PRs (30d)
- 350
Description
你运行的 Kimi Code 版本是?
2.0.1(已核对 2.0.2 及 main 主干相关代码相同,问题仍存在)
你使用的是哪个开放平台/订阅?
Kimi Code 会员
你使用的是哪个模型?
kimi-k3
你的电脑平台是?
Windows 11 + WSL2(Arch Linux),Linux 6.6.114.1-microsoft-standard-WSL2 x86_64
你遇到了什么问题?
在 Web UI(kimi web)中使用后台 Bash 时:后台任务完成后,完成通知以一条类似用户消息的形式插入对话流(功能正常,模型能读到)。但当模型仍在持续工作时,这条通知会一直停留在消息列表最底部——后续模型输出全部渲染在通知上方,通知不随新内容上滚。界面上看起来通知永远是最新一条消息。
复现步骤
- 打开
kimi web,在会话中让模型执行一个会持续多轮输出的任务; - 同时让模型启动一个后台 Bash(如
sleep 30 && echo done); - 在后台任务完成时保持模型继续输出;
- 观察到通知消息固定在底部,后续输出插在它上方。
源码层面定位(供参考,非定论):通知经 task.notified 事件进入 AgentTranscriptProjector.onTaskNotified(packages/kap-server/src/services/transcript/coreEventMap.ts)。用 2.0.1 tag 的官方投影器 + transcript store 可稳定复现一种错误排序:通知到达时若当前 step 正在流式输出文本,通知帧追加到 step 末尾后,后续 assistant.delta 仍写入通知之前的 openText 帧(onTextDelta 未关闭旧帧),产出帧序 [assistant全部文本, 通知]。但正常路径下通知在 turn 状态机 draining 阶段(step 间隙)消费,该分支未必是实际触发路径;前端实时渲染逻辑(源码不在本仓库,仅核对了打包产物无重排序)也可能有关。希望官方确认实际触发路径。
期望的行为
通知按时间顺序渲染,后续内容出现在通知下方,通知随新消息自然上滚。
补充信息
- 可稳定复现排序缺陷的最小测试(基于官方
AgentTranscriptProjector+AgentTranscript,非 mock):如需要可提供测试文件。 - 注意:仅在
onTaskNotified前调用flushOpenFrames不足以修复——adoptStreamFrame会重新认领到通知之前的旧文本帧。 - 相关但未覆盖本问题的 issue:#3464、#3387、#3617。
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in packages/kap-server/src/services/transcript/coreEventMap.ts, tracing AgentTranscriptProjector.onTaskNotified, onTextDelta, and the related transcript store behavior. Reproduce the reported streaming scenario with the minimal AgentTranscriptProjector and AgentTranscript test, then verify that notification and subsequent assistant output appear in chronological order; the issue notes that frontend rendering sources are outside this repository.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100