Skip to content

Conversation

@KeremTurgutlu
Copy link

@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
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

1 participant