Commit b052b57
Add stuck loop detection — auto-flush KV when model repeats itself
If the model returns the same response twice in a row (hash match),
force a KV cache flush. Catches short-response loops like "I am good"
that slip past the 40-char truncateRepetition() check.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 253a9d3 commit b052b57
1 file changed
Lines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
182 | 186 | | |
183 | 187 | | |
184 | 188 | | |
| |||
549 | 553 | | |
550 | 554 | | |
551 | 555 | | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
552 | 574 | | |
553 | 575 | | |
554 | 576 | | |
| |||
0 commit comments