- Previous fix required EXACT same tool call signature (including arguments)
- Bot was stuck reading file in sections with different line numbers
- New logic: detect stuck if SAME TOOL is called repeatedly (arguments may vary)
- Extract tool name from signature and check if all recent calls use same tool
- Still requires 3+ repetitions before triggering intervention
This fixes the infinite loop bug when bot tries to read large files in sections.
Test results: 4/4 tests passing (100%)
- ✅ Same tool, different args → STUCK detected
- ✅ Same tool, same args → STUCK detected
- ✅ Different tools → NOT stuck
- ✅ Same tool repeated at end → STUCK detected