Adds a ReasoningRepetitionDetector that monitors streaming reasoning/thinking
content for repetitive patterns. When a line is repeated more than a threshold
number of times (default 5), the stream is aborted early to save tokens and
the model receives guidance to try a different approach.
This addresses an issue where some models (particularly Gemini) get stuck in
reasoning loops, repeating the same lines like "I'll use attempt_completion"
or "I'll mention that I verified with tests" indefinitely.
Changes:
- New ReasoningRepetitionDetector class with streaming chunk support
- Integration into Task.ts reasoning streaming handler
- New reasoningRepetitionDetected response format for model guidance
- 18 unit tests covering detection, normalization, reset, and edge cases
Closes#11337