Closed brycecf closed 4 hours ago
Reusing a Context
object in llama-index-core=0.11.20
breaks workflow event streaming when running the workflow a second time because the Context
object maintains state across runs, including the _streaming_queue
and _broker_log
. These components are not reset between runs, leading to potential conflicts or unexpected behavior when the workflow is executed again [1].
A similar issue was discussed in a solved thread, where the behavior of streaming events from a nested workflow was addressed [2].
To continue talking to Dosu, mention @dosu.
Hmm weird. Made a much more simple version to reproduce here https://colab.research.google.com/drive/1O0aZLsLI1eUd2bxwdp-NBcXSHsZFxgIa?usp=sharing
Oh, I'm silly, I fixed it in the notebook above @brycecf
Its not workflow.stream_events():
its handler.stream_events()
Bug Description
With
llama-index-core=0.11.7
, I was able to pass an existing Context instance between runs of the same Workflow without issue.Using
llama-index-core=0.11.20
, a change to theContext.stream_events
breaks streaming events when running the Workflow a second time with an existing context.Version
0.11.20
Steps to Reproduce
Run the following:
Run the above code using this command:
Open the resulting chat UI and enter two separate prompts. The first will work and show the streamed events. The second will fail and provide the trace below.
Relevant Logs/Tracbacks