File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -411,7 +411,8 @@ async def run(
411411        if  run_config  is  None :
412412            run_config  =  RunConfig ()
413413
414-         # Prepare input with session if enabled 
414+         # Keep original user input separate from session-prepared input 
415+         original_user_input  =  input 
415416        prepared_input  =  await  self ._prepare_input_with_session (input , session )
416417
417418        tool_use_tracker  =  AgentToolUseTracker ()
@@ -438,8 +439,8 @@ async def run(
438439            current_agent  =  starting_agent 
439440            should_run_agent_start_hooks  =  True 
440441
441-             # save the original  input to the session if enabled  
442-             await  self ._save_result_to_session (session , original_input , [])
442+             # save only  the new user  input to the session, not the combined history  
443+             await  self ._save_result_to_session (session , original_user_input , [])
443444
444445            try :
445446                while  True :
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments