fix(core): ensure loop detection respects session disable flag (#12347)

This commit is contained in:
Sandy Tao
2025-10-31 09:06:10 -07:00
committed by GitHub
parent b31f6804fe
commit 11e1e98022
2 changed files with 18 additions and 1 deletions
@@ -123,7 +123,11 @@ export class LoopDetectionService {
* @returns true if a loop is detected, false otherwise
*/
addAndCheck(event: ServerGeminiStreamEvent): boolean {
if (this.loopDetected || this.disabledForSession) {
if (this.disabledForSession) {
return false;
}
if (this.loopDetected) {
return this.loopDetected;
}