来源:https://github.com/alibaba/spring-ai-alibaba/issues/4789
Activity
zeng-bohan commentedon Sep 4, 2026
在本仓 main 用离线桩模型(ReactAgent + 单工具 + MemorySaver + stub 流式模型)复现确认了这个 bug 依然存在,并补了一个可离线运行的回归测试:
复现:订阅
streamMessages后在流式过程中dispose(),检查 checkpoint:USER -> ASSISTANT(tool_call) -> TOOL(toolResponse) -> ASSISTANT(final)— 合法;USER -> ASSISTANT(tool_call)— 悬空的 tool_call,下一轮拼接 user 后同样会被 LLM API 拒绝(assistant tool_calls 后必须紧跟 tool 消息)。与本报告观察到的「toolResponse 已落库但 assistant 缺失」是同一类问题的两个变体:取消信号让一个多步 turn 只持久化了一半。
根因(与报告分析一致):
NodeExecutor.processGraphResponseFlux的尾部processedFlux.concatWith(updateContextMono.thenMany(...))—— 状态合并与buildNodeOutputAndAddCheckpoint完全依赖下游订阅拉动,取消即跳过;而嵌套异步路径上后续 tool 节点的落库与之不同步。修复方向(倾向 A,欢迎反馈):
确认方向后我提交带回归测试的 PR。