Skip to content

run sync tools with threads in call_func_async#73

Merged
jph00 merged 1 commit intomainfrom
feat/72-run-sync-tools-in-threads
Feb 13, 2026
Merged

run sync tools with threads in call_func_async#73
jph00 merged 1 commit intomainfrom
feat/72-run-sync-tools-in-threads

Conversation

@KeremTurgutlu
Copy link
Contributor

@KeremTurgutlu KeremTurgutlu commented Feb 9, 2026

call_func_async previously called sync functions directly on the event loop, blocking it and preventing asyncio.gather from running multiple tool calls concurrently. Now sync functions are wrapped in asyncio.to_thread, enabling true parallel execution. Async functions are detected via inspect.iscoroutinefunction and awaited directly as before.

Fixes #72

@KeremTurgutlu KeremTurgutlu changed the title run sync tools with threads in call_func_async run sync tools with threads in call_func_async Feb 9, 2026
@KeremTurgutlu KeremTurgutlu requested a review from jph00 February 9, 2026 15:48
@KeremTurgutlu KeremTurgutlu self-assigned this Feb 9, 2026
@KeremTurgutlu KeremTurgutlu added the enhancement New feature or request label Feb 9, 2026
@jph00
Copy link
Collaborator

jph00 commented Feb 13, 2026

Nice!

@jph00 jph00 merged commit e7c1d21 into main Feb 13, 2026
@jph00
Copy link
Collaborator

jph00 commented Feb 13, 2026

FYI @KeremTurgutlu it's best not to have both an issue and a PR, especially if they both have a label, otherwise we end up with both appearing in the changelog. If you want to add an issue to help track things, just leave it unlabelled.

@KeremTurgutlu
Copy link
Contributor Author

KeremTurgutlu commented Feb 13, 2026

FYI @KeremTurgutlu it's best not to have both an issue and a PR, especially if they both have a label, otherwise we end up with both appearing in the changelog. If you want to add an issue to help track things, just leave it unlabelled.

Didn't know about it, thanks for letting me know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

call_func_async: run sync functions in threads for parallel execution

2 participants