Skip to content

fix: parallel tool execution launches an unbounded goroutine per tool call#529

Closed
sam-saffron-jarvis wants to merge 1 commit intoSamSaffron:mainfrom
sam-saffron-jarvis:feat/codereview-0c52ae7a
Closed

fix: parallel tool execution launches an unbounded goroutine per tool call#529
sam-saffron-jarvis wants to merge 1 commit intoSamSaffron:mainfrom
sam-saffron-jarvis:feat/codereview-0c52ae7a

Conversation

@sam-saffron-jarvis
Copy link
Copy Markdown
Contributor

What

Bound parallel tool execution in Engine.executeToolCalls with a small worker pool instead of launching one goroutine per tool call.

Also adds a regression test that verifies parallel tool execution stays concurrent while respecting the configured worker limit.

Why

A single model response could previously fan out into an unbounded number of concurrent local tool executions, which can oversubscribe CPU, disk, and process limits and hurt overall throughput. Using a bounded worker pool preserves parallel execution while adding backpressure and preventing runaway goroutine/process fan-out.

@SamSaffron
Copy link
Copy Markdown
Owner

Closing as superseded by the parallel tool cap merged in db938ea.

@SamSaffron SamSaffron closed this May 7, 2026
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.

2 participants