[Bug] retryMessage 未正确处理流式失败场景 #5
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:571-609 的 retryMessage() 函数存在以下问题:
流式失败消息无法正确重试:当 SSE 流式失败降级到 fallback POST 时,消息数组中有占位消息 + 实际回复。如果 fallback 也失败 (第 530 行 outer catch),错误消息前对应的用户消息可能被占位消息隔开,导致 retryMessage 查找用户消息失败。
只移除一对用户消息+错误消息:如果流式失败后产生了占位消息 + 错误消息,重试时只移除用户消息和最后的错误消息,占位消息会残留在数组中。
涉及文件
frontend/src/views/AgentChat.vue:571-609
修复建议
严重程度
中 - 重试功能在流式失败场景下不可靠