cool-camera-83057
09/12/2025, 9:30 AM@pytest.mark.asyncio
async def test_complex_flow_add_remove_then_reservation_then_continue_and_confirm_delivery() -> None:
userdata, agent = myconfig()
async with (
agent.llm as llm,
agent as sess,
):
await sess.start(userdata.agents["commande"])
r1 = await sess.run(user_input="Je veux une 4 fromages")
r1.expect.skip_next_event_if(type="message", role="assistant")
r1.expect.next_event().is_function_call(name="update_order")
assert len(userdata.order) == 1
r2 = await sess.run(user_input="Finalement je la veux plus")
but the second sess.run is not working i got RuntimeError: AgentSession is closing, cannot use generate_reply()tall-airline-16756
09/12/2025, 9:30 AMtall-airline-16756
09/12/2025, 9:30 AMagent
and userdata
objects are initialized in your test setup? Also, if there are any particular steps or configurations in your myconfig()
function that might influence the session lifecycle, it would be great to know. I’m here to help you get this sorted out!