Replies: 2 comments
-
@Tehsmash that looks definitely like a bug, the two consecutive runs are supposed to be independent and provide different results. I'm creating an issue out of this GH discussion, it would be super helpful if you could add the smallest snippet of code I can use to replicate the issue. |
Beta Was this translation helpful? Give feedback.
-
Managed to recreate the issue with a limited amount of code: core.py:
workflow.py:
broken.py:
I run the control plane using I exercise the session like:
You can see that I get back the same output, but the workflow should always return the StartEvent input param. It seems like having any kind of "await" inside of the workflow step causes this behaviour on the second call to the workflow, in my real use case this is a Further investigation shows that this has something to do with sharing the ctx between workflows runs. This happens today because the WorkflowService stores and loads the context from the session not from the task ID): https://github.com/run-llama/llama_deploy/blob/main/llama_deploy/services/workflow.py#L250-L274 Removing llama_deploy control plane from the mix I can recreate the same issue by copying the behaviour of the WorkflowService: Reusing the context "normally":
Working Output:
Adding in the json pickle like the WorkflowService does:
Broken Output:
|
Beta Was this translation helpful? Give feedback.
-
I've been playing around with llama deploy over the last couple of days and noticed a quirk and I don't know if it's a bug or intended behaviour.
When I issue two runs on the same session, it creates separate "tasks" for the session, but regardless of the input of the second task the output is always the same as the first session.run call.
Looking at the logs of my workflow, on the second run it doesn't even execute the steps in the workflow it just returns the final result straight away.
Debugging this, it seems like every task received by the WorkflowService saves the workflow state and context using the session_id, which means a few things:
Can you confirm if there is a bug or misunderstanding here or not?
Beta Was this translation helpful? Give feedback.
All reactions