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 b0be1f1689
commit e860f517c0
9 changed files with 46 additions and 2 deletions

View File

@@ -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++;