Describe the bug
Session states are not saved after agent.interrupt().
正常的调用链路里面,在ReactAgent doCall 方法最后保存:
return scope.doCallInner(msgs)
.flatMap(result -> saveStateToSession(scope).thenReturn(result));
如果interrupt,会throw一个InterruptedException,这个 flatMap(saveStateToSession) 不会执行。AgentBase 会捕获 InterruptedException 并转到 handleInterrupt()。ReActAgent.handleInterrupt() 只是把一条 “I noticed that you have interrupted me...” 的 assistant 消息追加到session里面,但这里没有调用 saveStateToSession() 或 saveAgentState()。
是不是应该finally兜底啊?不管如何处理,都得把最终的状态保存一下
agnetscope版本:2.0.0-RC4
Describe the bug
Session states are not saved after agent.interrupt().
正常的调用链路里面,在ReactAgent doCall 方法最后保存:
如果interrupt,会throw一个InterruptedException,这个 flatMap(saveStateToSession) 不会执行。AgentBase 会捕获 InterruptedException 并转到 handleInterrupt()。ReActAgent.handleInterrupt() 只是把一条 “I noticed that you have interrupted me...” 的 assistant 消息追加到session里面,但这里没有调用 saveStateToSession() 或 saveAgentState()。
是不是应该finally兜底啊?不管如何处理,都得把最终的状态保存一下
agnetscope版本:2.0.0-RC4