File tree Expand file tree Collapse file tree 1 file changed +1
-4
lines changed Expand file tree Collapse file tree 1 file changed +1
-4
lines changed Original file line number Diff line number Diff line change @@ -216,22 +216,19 @@ async def execute_tools_and_side_effects(
216216 run_config .model_settings and
217217 cls ._should_reset_tool_choice (run_config .model_settings , tools )
218218 ):
219- # Also update the run_config model settings with a copy
219+ # update the run_config model settings with a copy
220220 new_run_config_settings = dataclasses .replace (
221221 run_config .model_settings ,
222222 tool_choice = "auto"
223223 )
224- # Create a new run_config with the new settings
225224 run_config = dataclasses .replace (run_config , model_settings = new_run_config_settings )
226225
227- # Only reset in the problematic scenarios where loops are likely unintentional
228226 if cls ._should_reset_tool_choice (agent .model_settings , tools ):
229227 # Create a modified copy instead of modifying the original agent
230228 new_model_settings = dataclasses .replace (
231229 agent .model_settings ,
232230 tool_choice = "auto"
233231 )
234- # Create a new internal agent with updated settings
235232 agent = dataclasses .replace (agent , model_settings = new_model_settings )
236233
237234 # Second, check if there are any handoffs
You can’t perform that action at this time.
0 commit comments