@@ -54,7 +54,8 @@ impl SessionLane {
5454 /// Map a tool name to its lane
5555 pub fn from_tool_name ( tool_name : & str ) -> Self {
5656 match tool_name {
57- "read" | "glob" | "ls" | "grep" | "list_files" | "search" => SessionLane :: Query ,
57+ "read" | "glob" | "ls" | "grep" | "list_files" | "search"
58+ | "web_fetch" | "web_search" => SessionLane :: Query ,
5859 "bash" | "write" | "edit" | "delete" | "move" | "copy" | "execute" => {
5960 SessionLane :: Execute
6061 }
@@ -215,6 +216,16 @@ pub struct SessionQueueConfig {
215216 /// Per-lane timeout overrides in milliseconds
216217 #[ serde( default ) ]
217218 pub lane_timeouts : HashMap < SessionLane , u64 > ,
219+
220+ // ========================================================================
221+ // Query-lane tool parallelization strategy
222+ // ========================================================================
223+ /// Enable Query-lane tool parallelization (default: false, serial execution)
224+ #[ serde( default ) ]
225+ pub enable_parallelization : bool ,
226+ /// Parallelization strategy configuration
227+ #[ serde( default ) ]
228+ pub parallelization_strategy : Option < ParallelizationStrategy > ,
218229}
219230
220231/// Retry policy configuration
@@ -280,6 +291,53 @@ fn default_generate_concurrency() -> usize {
280291 2
281292}
282293
294+ // ============================================================================
295+ // Parallelization Strategy
296+ // ============================================================================
297+
298+ /// Strategy for Query-lane tool parallelization
299+ #[ derive( Debug , Clone , Serialize , Deserialize ) ]
300+ #[ serde( rename_all = "camelCase" ) ]
301+ pub struct ParallelizationStrategy {
302+ /// Minimum number of tools required to trigger parallelization (default: 8)
303+ #[ serde( default = "default_min_tool_count" ) ]
304+ pub min_tool_count : usize ,
305+
306+ /// Allowed tool types for parallelization (empty = allow all Query-lane tools)
307+ #[ serde( default ) ]
308+ pub allowed_tools : Vec < String > ,
309+
310+ /// Blocked tool types (takes precedence over allowed_tools)
311+ #[ serde( default ) ]
312+ pub blocked_tools : Vec < String > ,
313+ }
314+
315+ fn default_min_tool_count ( ) -> usize {
316+ 8
317+ }
318+
319+ impl Default for ParallelizationStrategy {
320+ fn default ( ) -> Self {
321+ Self {
322+ min_tool_count : 8 ,
323+ allowed_tools : vec ! [
324+ "read" . to_string( ) ,
325+ "grep" . to_string( ) ,
326+ "glob" . to_string( ) ,
327+ "ls" . to_string( ) ,
328+ "web_fetch" . to_string( ) ,
329+ "web_search" . to_string( ) ,
330+ ] ,
331+ blocked_tools : vec ! [
332+ "bash" . to_string( ) ,
333+ "write" . to_string( ) ,
334+ "edit" . to_string( ) ,
335+ "patch" . to_string( ) ,
336+ ] ,
337+ }
338+ }
339+ }
340+
283341impl Default for SessionQueueConfig {
284342 fn default ( ) -> Self {
285343 Self {
@@ -299,6 +357,8 @@ impl Default for SessionQueueConfig {
299357 priority_boost : None ,
300358 pressure_threshold : None ,
301359 lane_timeouts : HashMap :: new ( ) ,
360+ enable_parallelization : false , // Default: serial execution
361+ parallelization_strategy : None ,
302362 }
303363 }
304364}
0 commit comments