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(
411
411
if run_config is None :
412
412
run_config = RunConfig ()
413
413
414
- # Prepare input with session if enabled
414
+ # Keep original user input separate from session-prepared input
415
+ original_user_input = input
415
416
prepared_input = await self ._prepare_input_with_session (input , session )
416
417
417
418
tool_use_tracker = AgentToolUseTracker ()
@@ -438,8 +439,8 @@ async def run(
438
439
current_agent = starting_agent
439
440
should_run_agent_start_hooks = True
440
441
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 , [])
443
444
444
445
try :
445
446
while True :
You can’t perform that action at this time.
0 commit comments