()
| 2430 | |
| 2431 | #[tokio::test] |
| 2432 | async fn parallel_task_both_inherit_permissions() { |
| 2433 | let workspace = tempfile::tempdir().unwrap(); |
| 2434 | let mock = Arc::new(MockLlmClient::new(vec![ |
| 2435 | // Task 1 responses |
| 2436 | MockLlmClient::tool_call_response( |
| 2437 | "t1", |
| 2438 | "write", |
| 2439 | serde_json::json!({ |
| 2440 | "file_path": workspace.path().join("p1.txt").to_string_lossy(), |
| 2441 | "content": "P1" |
| 2442 | }), |
| 2443 | ), |
| 2444 | MockLlmClient::text_response("Done 1."), |
| 2445 | // Task 2 responses |
| 2446 | MockLlmClient::tool_call_response( |
| 2447 | "t2", |
| 2448 | "write", |
| 2449 | serde_json::json!({ |
| 2450 | "file_path": workspace.path().join("p2.txt").to_string_lossy(), |
| 2451 | "content": "P2" |
| 2452 | }), |
| 2453 | ), |
| 2454 | MockLlmClient::text_response("Done 2."), |
| 2455 | ])); |
| 2456 | |
| 2457 | let executor = Arc::new(TaskExecutor::new( |
| 2458 | test_registry_with_writer(), |
| 2459 | mock, |
| 2460 | workspace.path().to_string_lossy().to_string(), |
| 2461 | )); |
| 2462 | |
| 2463 | let tasks = vec![ |
| 2464 | TaskParams { |
| 2465 | agent: "writer".to_string(), |
| 2466 | description: "Write p1".to_string(), |
| 2467 | prompt: "Write p1.txt".to_string(), |
| 2468 | background: false, |
| 2469 | max_steps: Some(3), |
| 2470 | }, |
| 2471 | TaskParams { |
| 2472 | agent: "writer".to_string(), |
| 2473 | description: "Write p2".to_string(), |
| 2474 | prompt: "Write p2.txt".to_string(), |
| 2475 | background: false, |
| 2476 | max_steps: Some(3), |
| 2477 | }, |
| 2478 | ]; |
| 2479 | |
| 2480 | let results = executor.execute_parallel(tasks, None, None).await; |
| 2481 | assert_eq!(results.len(), 2); |
| 2482 | |
| 2483 | for result in &results { |
| 2484 | assert!( |
| 2485 | result.success, |
| 2486 | "parallel child should succeed: {}", |
| 2487 | result.output |
| 2488 | ); |
| 2489 | } |
nothing calls this directly
no test coverage detected