[Bug] SSE 事件类型与后端 runtime 对齐检查 #4
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 监听以下 SSE 事件类型:think, tool_call, tool_result, final, error。
后端 agent_chat.py 的 _sse_stream() 函数通过 event.get("type", "message") 动态确定事件类型,取决于 AgentRuntime.run_stream() yield 的 dict 中的 type 字段。
需要确认 agent_runtime/core.py 中 run_stream() 实际 yield 的事件类型是否与前端完全匹配。如果前后端事件类型不一致,对应的事件会被前端静默忽略 (catch 块只跳过不做处理),导致:
涉及文件
建议
严重程度
中 - 可能导致流式功能部分失效