Skip to content

Commit 351e959

Browse files
committed
refactor: remove internal Query-lane auto-parallelization
Remove the incorrect internal parallelization mechanism that automatically ran Query-lane tools in parallel within a single LLM turn. This was replaced by the correct External Task Handler pattern (coordinator/worker) which provides opt-in parallel execution via set_lane_handler(). Removed: - ParallelizationStrategy struct and enable_parallelization field (queue.rs) - partition_by_lane(), should_use_parallel_execution(), execute_query_tools_parallel() (agent.rs) - Parallelization fields from AgentLoop and AgentSession (agent.rs, agent_api.rs) - PyParallelizationStrategy class (Python SDK) - ParallelizationStrategy/enableParallelization (Node SDK) - 8 example files: test_internal_parallel.rs/py/js and test_session_parallel_*.py - docs/parallelization.md and crates/code/docs/parallelization_configuration.md - partition_by_lane tests (5 tests removed) Kept: - External Task Handler pattern (set_lane_handler, pending_external_tasks, complete_external_task) - Planning-mode step parallelization (JoinSet-based, unrelated) - test_external_task_handler examples for all three SDKs All 1133 lib tests pass, zero warnings.
1 parent 7377392 commit 351e959

16 files changed

Lines changed: 20 additions & 2162 deletions

core/examples/test_external_task_handler.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ async fn main() -> Result<()> {
109109

110110
// 3. Stream a prompt that will trigger Execute-lane tools (bash)
111111
let start = Instant::now();
112-
let session_clone = session.clone();
113112

114113
let (mut rx, _handle) = session
115114
.stream(
@@ -131,7 +130,7 @@ async fn main() -> Result<()> {
131130
println!(" 📥 ExternalTaskPending: {} ({})", &task_id[..8], command_type);
132131

133132
// Poll all pending tasks
134-
let tasks = session_clone.pending_external_tasks().await;
133+
let tasks = session.pending_external_tasks().await;
135134
for task in tasks {
136135
println!(" 🔧 Worker processing: {} → {}", task.command_type, &task.task_id[..8]);
137136

@@ -153,7 +152,7 @@ async fn main() -> Result<()> {
153152
}
154153

155154
// Complete the external task
156-
let completed = session_clone
155+
let completed = session
157156
.complete_external_task(
158157
&task.task_id,
159158
ExternalTaskResult {

core/examples/test_internal_parallel.rs

Lines changed: 0 additions & 182 deletions
This file was deleted.

0 commit comments

Comments
 (0)