@@ -117,8 +117,8 @@ def test_endpoint_agent_id_extraction(self, mock_encoder_class, app, mock_agent,
117
117
client = TestClient (app )
118
118
response = client .post ("/agent123" , json = sample_input .model_dump ())
119
119
120
- # Agent should be called with agent_id extracted from path
121
- mock_agent .run .assert_called_once_with (sample_input , "agent123" )
120
+ # Agent should be called with just the input data
121
+ mock_agent .run .assert_called_once_with (sample_input )
122
122
assert response .status_code == 200
123
123
124
124
@patch ('adk_middleware.endpoint.EventEncoder' )
@@ -142,8 +142,8 @@ def test_endpoint_root_path_agent_id(self, mock_encoder_class, app, mock_agent,
142
142
client = TestClient (app )
143
143
response = client .post ("/" , json = sample_input .model_dump ())
144
144
145
- # Agent should be called with empty agent_id for root path
146
- mock_agent .run .assert_called_once_with (sample_input , "" )
145
+ # Agent should be called with just the input data
146
+ mock_agent .run .assert_called_once_with (sample_input )
147
147
assert response .status_code == 200
148
148
149
149
@patch ('adk_middleware.endpoint.EventEncoder' )
@@ -167,7 +167,7 @@ def test_endpoint_successful_event_streaming(self, mock_logger, mock_encoder_cla
167
167
run_id = "test_run"
168
168
)
169
169
170
- async def mock_agent_run (input_data , agent_id ):
170
+ async def mock_agent_run (input_data ):
171
171
yield mock_event1
172
172
yield mock_event2
173
173
@@ -204,7 +204,7 @@ def test_endpoint_encoding_error_handling(self, mock_logger, mock_encoder_class,
204
204
run_id = "test_run"
205
205
)
206
206
207
- async def mock_agent_run (input_data , agent_id ):
207
+ async def mock_agent_run (input_data ):
208
208
yield mock_event
209
209
210
210
mock_agent .run = mock_agent_run
@@ -245,7 +245,7 @@ def test_endpoint_encoding_error_double_failure(self, mock_logger, mock_encoder_
245
245
run_id = "test_run"
246
246
)
247
247
248
- async def mock_agent_run (input_data , agent_id ):
248
+ async def mock_agent_run (input_data ):
249
249
yield mock_event
250
250
251
251
mock_agent .run = mock_agent_run
@@ -276,7 +276,7 @@ def test_endpoint_agent_error_handling(self, mock_logger, mock_encoder_class, ap
276
276
mock_encoder_class .return_value = mock_encoder
277
277
278
278
# Mock agent to raise an error
279
- async def mock_agent_run (input_data , agent_id ):
279
+ async def mock_agent_run (input_data ):
280
280
raise RuntimeError ("Agent failed" )
281
281
282
282
mock_agent .run = mock_agent_run
@@ -309,7 +309,7 @@ def test_endpoint_agent_error_encoding_failure(self, mock_logger, mock_encoder_c
309
309
mock_encoder_class .return_value = mock_encoder
310
310
311
311
# Mock agent to raise an error
312
- async def mock_agent_run (input_data , agent_id ):
312
+ async def mock_agent_run (input_data ):
313
313
raise RuntimeError ("Agent failed" )
314
314
315
315
mock_agent .run = mock_agent_run
@@ -345,7 +345,7 @@ def test_endpoint_returns_streaming_response(self, mock_encoder_class, app, mock
345
345
run_id = "test_run"
346
346
)
347
347
348
- async def mock_agent_run (input_data , agent_id ):
348
+ async def mock_agent_run (input_data ):
349
349
yield mock_event
350
350
351
351
mock_agent .run = mock_agent_run
@@ -385,7 +385,7 @@ def test_endpoint_no_accept_header(self, mock_encoder_class, app, mock_agent, sa
385
385
run_id = "test_run"
386
386
)
387
387
388
- async def mock_agent_run (input_data , agent_id ):
388
+ async def mock_agent_run (input_data ):
389
389
yield mock_event
390
390
391
391
mock_agent .run = mock_agent_run
@@ -459,7 +459,7 @@ def test_create_app_functional_test(self, mock_encoder_class, mock_agent):
459
459
run_id = "test_run"
460
460
)
461
461
462
- async def mock_agent_run (input_data , agent_id ):
462
+ async def mock_agent_run (input_data ):
463
463
yield mock_event
464
464
465
465
mock_agent .run = mock_agent_run
@@ -530,8 +530,8 @@ def test_full_endpoint_flow(self, mock_encoder_class, mock_agent, sample_input):
530
530
531
531
call_args = []
532
532
533
- async def mock_agent_run (input_data , agent_id ):
534
- call_args .append (( input_data , agent_id ) )
533
+ async def mock_agent_run (input_data ):
534
+ call_args .append (input_data )
535
535
for event in events :
536
536
yield event
537
537
@@ -552,8 +552,7 @@ async def mock_agent_run(input_data, agent_id):
552
552
553
553
# Verify agent was called correctly
554
554
assert len (call_args ) == 1
555
- assert call_args [0 ][0 ] == sample_input
556
- assert call_args [0 ][1 ] == "integration"
555
+ assert call_args [0 ] == sample_input
557
556
558
557
# Verify events were encoded
559
558
assert mock_encoder .encode .call_count == len (events )
@@ -589,7 +588,7 @@ def test_endpoint_with_long_running_stream(self, mock_encoder_class, mock_agent,
589
588
mock_encoder_class .return_value = mock_encoder
590
589
591
590
# Mock agent to return many events
592
- async def mock_agent_run (input_data , agent_id ):
591
+ async def mock_agent_run (input_data ):
593
592
for i in range (10 ):
594
593
yield RunStartedEvent (
595
594
type = EventType .RUN_STARTED ,
0 commit comments