feat(core): add setting to disable loop detection (#18008)

This commit is contained in:
Sandy Tao
2026-02-02 10:13:20 -08:00
committed by GitHub
parent 0705bd6dce
commit 8693b41dbf
9 changed files with 46 additions and 2 deletions
@@ -147,7 +147,7 @@ export class LoopDetectionService {
* @returns true if a loop is detected, false otherwise
*/
addAndCheck(event: ServerGeminiStreamEvent): boolean {
if (this.disabledForSession) {
if (this.disabledForSession || this.config.getDisableLoopDetection()) {
return false;
}
@@ -182,7 +182,7 @@ export class LoopDetectionService {
* @returns A promise that resolves to `true` if a loop is detected, and `false` otherwise.
*/
async turnStarted(signal: AbortSignal) {
if (this.disabledForSession) {
if (this.disabledForSession || this.config.getDisableLoopDetection()) {
return false;
}
this.turnsInCurrentPrompt++;