Skip to content

Allow publishing status log events while long-running tool calls are executing#238

Merged
scottpersinger merged 2 commits intomainfrom
queue_sleep
Jun 19, 2025
Merged

Allow publishing status log events while long-running tool calls are executing#238
scottpersinger merged 2 commits intomainfrom
queue_sleep

Conversation

@scottpersinger
Copy link
Collaborator

I knew we needed that event queue for something!

This PR passes our event queue down into the ThreadContext, so that in your long running tool function you can call:

run_context.log("This function will take a while!")

and we will immediately queue the log event, thanks to time.sleep(0), that event will get delivered to your client before your tool call finishes. This lets you send status updates during long running tool calls.

@scottpersinger scottpersinger merged commit 083d897 into main Jun 19, 2025
2 checks passed
@scottpersinger scottpersinger deleted the queue_sleep branch June 19, 2025 23:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant