Skip to content

feat: concurrent tool execution via anyio.create_task_group - #7

Closed
mattapperson wants to merge 1 commit into
mainfrom
worktree-agent-a30ee03d
Closed

feat: concurrent tool execution via anyio.create_task_group#7
mattapperson wants to merge 1 commit into
mainfrom
worktree-agent-a30ee03d

Conversation

@mattapperson

Copy link
Copy Markdown
Contributor

Summary

  • Replaces serial tool execution in _tool_orchestrator.py with concurrent execution using anyio.create_task_group
  • Pre-allocates a result list indexed by position to preserve original tool call ordering
  • Broadcasts events in deterministic order after all tools complete

Test plan

  • New test test_concurrent_tool_execution_wall_clock verifies two tools sleeping 0.05s each complete in under 0.1s wall-clock (proving concurrency)
  • All 80 existing tests pass
  • ruff check clean
  • mypy shows only pre-existing errors (none introduced by this change)

Tool calls in the orchestrator loop previously ran serially. This replaces
the sequential for-loop with concurrent execution using anyio.create_task_group,
while preserving result ordering via a pre-allocated list and broadcasting
events in original order after all tools complete.
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