File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -1314,15 +1314,19 @@ async def _start_streaming(
13141314 streamed_result ._event_queue .put_nowait (AgentUpdatedStreamEvent (new_agent = current_agent ))
13151315
13161316 try :
1317- # Prepare input with session if enabled
1318- prepared_input = await AgentRunner ._prepare_input_with_session (
1319- starting_input , session , run_config .session_input_callback
1320- )
1317+ # Prepare input with session if enabled (skip if resuming from state)
1318+ if run_state is None :
1319+ prepared_input = await AgentRunner ._prepare_input_with_session (
1320+ starting_input , session , run_config .session_input_callback
1321+ )
13211322
1322- # Update the streamed result with the prepared input
1323- streamed_result .input = prepared_input
1323+ # Update the streamed result with the prepared input
1324+ streamed_result .input = prepared_input
13241325
1325- await AgentRunner ._save_result_to_session (session , starting_input , [])
1326+ await AgentRunner ._save_result_to_session (session , starting_input , [])
1327+ else :
1328+ # When resuming, starting_input is already prepared from RunState
1329+ prepared_input = starting_input
13261330
13271331 # If resuming from an interrupted state, execute approved tools first
13281332 if run_state is not None and run_state ._current_step is not None :
You can’t perform that action at this time.
0 commit comments