Skip to content

Commit

Permalink
Run on_chat_resume() before resume_thread() (#968)
Browse files Browse the repository at this point in the history
Execute the on_chat_resume decorator before the resume_thread emitter.
This allows the `thread` in on_chat_resume to be updated on load.
  • Loading branch information
maciejwie committed May 7, 2024
1 parent d9fa5ba commit 9e6a5b2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backend/chainlit/socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@ async def connection_successful(sid):
"first_interaction",
{"interaction": "resume", "thread_id": thread.get("id")},
)
await context.emitter.resume_thread(thread)
await config.code.on_chat_resume(thread)
await context.emitter.resume_thread(thread)
return

if config.code.on_chat_start:
Expand Down

0 comments on commit 9e6a5b2

Please sign in to comment.