Skip to content

Conversation

@glesperance
Copy link
Contributor

Fix streaming status message callback mutation

Bug
streamify was appending StatusStreamingCallback directly to the shared settings.callbacks list.

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 streamify now 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.

@glesperance glesperance changed the title BUG (+FIX): streamify was appending StatusStreamingCallback directly to the shared settings.callbacks list FIX: streamify was appending StatusStreamingCallback directly to the shared settings.callbacks list Nov 18, 2025
@glesperance glesperance force-pushed the fix/streamify-callbacks-settings-leak branch from e7a8f45 to 2497b19 Compare November 18, 2025 20:03
Copy link
Collaborator

@chenmoneygithub chenmoneygithub left a 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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants