chainlit
chainlit copied to clipboard
End chat lifecycle is called twice
trafficstars
Describe the bug
The on_chat_end hook is called twice.
To Reproduce Steps to reproduce the behavior:
@cl.on_chat_start
async def on_chat_start():
print("on_chat_start")
@cl.on_chat_end
async def end_chat():
print("on_chat_end")
- Navigate to
/ - Click on
New Chat - Submit at least one message.
- Observe in logs that
on_chat_endis called twice.
Expected behavior
The on_chat_end hook is called once.
Screenshots
https://github.com/Chainlit/chainlit/assets/590874/91bf99af-96f8-457e-9893-7d71ec6f62d8
Additional context Chainlit 1.0.506