| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
Hey - I've left some high level feedback:
Please address the comments from this code review:
## Overall Comments
- To keep the streaming and non-streaming paths from diverging again, consider extracting the shared `OnAfterMessageSentEvent` + `clear_result` logic into a small helper so both branches call the same code.
- Double-check that calling `event.clear_result()` after `send_streaming` matches the non-streaming path ordering (i.e., hooks can still access any required response data before it is cleared); if not, you may want to clear earlier or pass required data into the hook explicitly.
- It may be worth wrapping `send_streaming` and the subsequent hook invocation in a `try`/`finally` to guarantee `event.clear_result()` is called even if streaming or hook execution raises, avoiding potential state leaks between requests.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
The streaming output path in RespondStage early-returns after send_streaming(), skipping the OnAfterMessageSentEvent dispatch that the non-streaming path performs.
This means plugins hooking after_message_sent (e.g. simple_memory _capture) never fire for streaming platforms such as webchat.
Change
Add the same OnAfterMessageSentEvent dispatch after send_streaming() completes, matching the non-streaming path:
Test plan
Summary by Sourcery
Bug Fixes:
Fixes #9740