[Bug] streamTimeout 在流式成功结束后未清理 #2
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
问题描述
AgentChat.vue:411 设置了 60s 超时定时器 streamTimeout。当 SSE 流正常完成时 (reader.read() 返回 done: true,while 循环正常退出),该定时器从未被 clearTimeout 清理。
60s 后回调触发 abortController.abort(),但由于 fetch 已结束,不会造成功能问题。但这属于资源泄漏,如果用户频繁发送消息,可能积累大量未清理的定时器。
涉及文件
frontend/src/views/AgentChat.vue:411-504
修复建议
在 while(true) 循环正常退出后 (第 504 行后),调用 clearTimeout(streamTimeout)。
严重程度
低 - 资源泄漏,无功能影响