Skip to content

Comments

feat: parallel execution of native tool_use calls#486

Merged
bug-ops merged 4 commits intomainfrom
feat/m27/parallel-tool-execution
Feb 17, 2026
Merged

feat: parallel execution of native tool_use calls#486
bug-ops merged 4 commits intomainfrom
feat/m27/parallel-tool-execution

Conversation

@bug-ops
Copy link
Owner

@bug-ops bug-ops commented Feb 17, 2026

Summary

  • Replace sequential for-loop in handle_native_tool_calls() with futures::join_all for concurrent tool execution
  • When tool count exceeds max_parallel_tools (default 8), uses stream::buffered() to cap concurrency while preserving result ordering
  • Post-processing (metrics, channel sends, message building) remains sequential

Changes

  • crates/zeph-core/src/agent/streaming.rs — parallel execution via join_all/buffered
  • crates/zeph-core/src/config/types.rsmax_parallel_tools field in TimeoutConfig
  • crates/zeph-core/Cargo.toml — added futures dependency
  • config/default.toml — documented new config key

Test plan

  • parallel_preserves_result_order — verifies ordering after join_all
  • parallel_faster_than_sequential — concurrent execution faster than sequential
  • one_failure_does_not_block_others — failure isolation
  • buffered_preserves_order — bounded concurrency preserves order
  • Full test suite: 1584 tests pass, 0 failures
  • cargo clippy --workspace -- -D warnings clean
  • Security audit: no race conditions, no shared mutable state issues

Closes #485

Replace sequential for-loop in handle_native_tool_calls() with
futures::join_all for concurrent tool execution. When tool count
exceeds max_parallel_tools (default 8), uses stream::buffered()
to cap concurrency while preserving result ordering.

Closes #485
@github-actions github-actions bot added the tests label Feb 17, 2026
@bug-ops bug-ops enabled auto-merge (squash) February 17, 2026 22:17
@bug-ops bug-ops merged commit d92ddb5 into main Feb 17, 2026
18 checks passed
@bug-ops bug-ops deleted the feat/m27/parallel-tool-execution branch February 17, 2026 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Parallel execution of multiple native tool_use calls

1 participant