Bug Description
In RespondStage.process(), the streaming output path (ResultContentType.STREAMING_RESULT) calls send_streaming() and then early-returns without dispatching OnAfterMessageSentEvent. The non-streaming path correctly dispatches this event before clear_result().
This means plugins hooking into after_message_sent (e.g. simple_memory _capture) never fire for streaming platforms such as webchat.
Reproduction
- Use a streaming-capable platform (e.g. webchat)
- Add a plugin that hooks
after_message_sent
- Send a message — the hook never fires
Fix
Dispatch OnAfterMessageSentEvent and call clear_result() in the streaming path, matching the non-streaming path. Extract the shared logic into a _after_sent_cleanup helper to prevent the two paths from diverging again.
Fix in #9733
Bug Description
In
RespondStage.process(), the streaming output path (ResultContentType.STREAMING_RESULT) callssend_streaming()and then early-returns without dispatchingOnAfterMessageSentEvent. The non-streaming path correctly dispatches this event beforeclear_result().This means plugins hooking into
after_message_sent(e.g.simple_memory_capture) never fire for streaming platforms such as webchat.Reproduction
after_message_sentFix
Dispatch
OnAfterMessageSentEventand callclear_result()in the streaming path, matching the non-streaming path. Extract the shared logic into a_after_sent_cleanuphelper to prevent the two paths from diverging again.Fix in #9733