From 5833e6de2bc348df2e9432a5f49e95a5dabe235d Mon Sep 17 00:00:00 2001 From: Adil Hafeez Date: Mon, 15 Dec 2025 23:08:54 -0800 Subject: [PATCH] fix tests --- crates/brightstaff/src/handlers/agent_selector.rs | 1 + crates/brightstaff/src/handlers/integration_tests.rs | 8 ++++++-- crates/brightstaff/src/handlers/pipeline_processor.rs | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/crates/brightstaff/src/handlers/agent_selector.rs b/crates/brightstaff/src/handlers/agent_selector.rs index 10745c34..7fb1c07f 100644 --- a/crates/brightstaff/src/handlers/agent_selector.rs +++ b/crates/brightstaff/src/handlers/agent_selector.rs @@ -222,6 +222,7 @@ mod tests { kind: Some("test".to_string()), url: "http://localhost:8080".to_string(), tool: None, + transport: None, } } diff --git a/crates/brightstaff/src/handlers/integration_tests.rs b/crates/brightstaff/src/handlers/integration_tests.rs index e09ed4f2..a0ff4499 100644 --- a/crates/brightstaff/src/handlers/integration_tests.rs +++ b/crates/brightstaff/src/handlers/integration_tests.rs @@ -42,7 +42,7 @@ mod integration_tests { // Setup services let router_service = create_test_router_service(); let agent_selector = AgentSelector::new(router_service); - let pipeline_processor = PipelineProcessor::default(); + let mut pipeline_processor = PipelineProcessor::default(); // Create test data let agents = vec![ @@ -50,11 +50,15 @@ mod integration_tests { id: "filter-agent".to_string(), kind: Some("filter".to_string()), url: "http://localhost:8081".to_string(), + tool: None, + transport: None, }, Agent { id: "terminal-agent".to_string(), kind: Some("terminal".to_string()), url: "http://localhost:8082".to_string(), + tool: None, + transport: None, }, ]; @@ -107,7 +111,7 @@ mod integration_tests { let headers = HeaderMap::new(); let result = pipeline_processor - .process_filter_chain(&request, &test_pipeline, &agent_map, &headers) + .process_filter_chain(&request.messages, &test_pipeline, &agent_map, &headers) .await; println!("Pipeline processing result: {:?}", result); diff --git a/crates/brightstaff/src/handlers/pipeline_processor.rs b/crates/brightstaff/src/handlers/pipeline_processor.rs index 0423074e..f01616c9 100644 --- a/crates/brightstaff/src/handlers/pipeline_processor.rs +++ b/crates/brightstaff/src/handlers/pipeline_processor.rs @@ -391,7 +391,7 @@ mod tests { #[tokio::test] async fn test_agent_not_found_error() { - let processor = PipelineProcessor::default(); + let mut processor = PipelineProcessor::default(); let agent_map = HashMap::new(); let request_headers = HeaderMap::new(); @@ -404,7 +404,7 @@ mod tests { let pipeline = create_test_pipeline(vec!["nonexistent-agent", "terminal-agent"]); let result = processor - .process_filter_chain(&initial_request, &pipeline, &agent_map, &request_headers) + .process_filter_chain(&initial_request.messages, &pipeline, &agent_map, &request_headers) .await; assert!(result.is_err());