The 'Mandatory Tool' Trap: Breaking Required Loops
Resolving infinite loops caused by 'tool_choice: required' configurations.
Steps
- Detect the 'tool_choice: required' configuration at session start.
- Track 'No-Op' tool calls with redundant or empty parameters.
- Force-switch to 'tool_choice: auto' if loop count exceeds 3 turns.
- Inject a 'Goal Verification' prompt to check for task progression.
- Terminate if the model requests the same tool with the same result 3x.