diff --git a/src/agents/tool-loop-detection.ts b/src/agents/tool-loop-detection.ts index 4aae534c15..1576e7ace9 100644 --- a/src/agents/tool-loop-detection.ts +++ b/src/agents/tool-loop-detection.ts @@ -55,7 +55,7 @@ type ResolvedLoopDetectionConfig = { }; function asPositiveInt(value: number | undefined, fallback: number): number { - if (!Number.isInteger(value) || value <= 0) { + if (typeof value !== "number" || !Number.isInteger(value) || value <= 0) { return fallback; } return value;