- Notifications
You must be signed in to change notification settings - Fork2.4k
FIX: streamify was appending StatusStreamingCallback directly to the shared settings.callbacks list#9073
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Conversation
e7a8f45 to2497b19Compare
chenmoneygithub left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Thanks for spotting the bug and putting up the PR!
Uh oh!
There was an error while loading.Please reload this page.
glesperance commentedNov 25, 2025
@chenmoneygithub just bumping this in case you missed the notif about the new commit fixing the issue you brought up |
chenmoneygithub left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Thank you for the updates and reminder! One comment about the testing, then it should be good to go!
| @pytest.mark.anyio | ||
| asyncdeftest_default_then_custom_status_message_provider(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
We may want to refactor the testing a bit - instead of default => custom, we can put up two threads that apply differentMyStatusMessageProvider, and verify that both threads work as expected. Then at the end we verify that the callback is not being modified.
Fix streaming status message callback mutation
Bug
streamifywas appendingStatusStreamingCallbackdirectly to the sharedsettings.callbackslist.That list was mutated in place and reused across calls, callbacks (and their status message providers) leaked between different
dspy.streamify(...)invocations.Fix
Each call to
streamifynow works on an isolated callback list by copying the global callbacks before modification.This prevents callback leakage between programs, ensures that custom status message providers only affect the specific program they are passed to, and restores the correct, deterministic status message behavior required by the tests.