Feature/tool parallel execution #504
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
引入
toolGrouping.ts模块,实现智能工具调用分组策略,在保证执行正确性的前提下最大化并行度,显著提升性能。关键特性
三类工具分类:安全并行工具(只读)、文件写入工具(冲突检测)、全局副作用工具(强制串行)
智能文件冲突检测:通过路径标准化和访问跟踪,确保同一文件的多次写入按顺序执行
读写分离:只读操作聚合并行,写入操作根据文件依赖智能分组
安全保障:全局副作用工具(bash、todowrite)和 MCP 工具完全隔离执行
性能提升
多个只读操作(read/grep/ls)并行执行
不同文件的写入操作(write/edit)可在同一组内并行
避免不必要的串行等待,减少总执行时间