From ff3722a3a74b09cd25b03de41933944a55db6351 Mon Sep 17 00:00:00 2001 From: Bryan Morgan Date: Mon, 14 Jul 2025 16:20:06 -0400 Subject: Fix circular reference JSON serialization in telemetry logging (#4150) --- packages/core/src/utils/quotaErrorDetection.ts | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) (limited to 'packages/core/src/utils/quotaErrorDetection.ts') diff --git a/packages/core/src/utils/quotaErrorDetection.ts b/packages/core/src/utils/quotaErrorDetection.ts index a8e87a5d..b07309cd 100644 --- a/packages/core/src/utils/quotaErrorDetection.ts +++ b/packages/core/src/utils/quotaErrorDetection.ts @@ -44,20 +44,9 @@ export function isProQuotaExceededError(error: unknown): boolean { // - "Quota exceeded for quota metric 'Gemini 2.5-preview Pro Requests'" // We use string methods instead of regex to avoid ReDoS vulnerabilities - const checkMessage = (message: string): boolean => { - console.log('[DEBUG] isProQuotaExceededError checking message:', message); - const result = - message.includes("Quota exceeded for quota metric 'Gemini") && - message.includes("Pro Requests'"); - console.log('[DEBUG] isProQuotaExceededError result:', result); - return result; - }; - - // Log the full error object to understand its structure - console.log( - '[DEBUG] isProQuotaExceededError - full error object:', - JSON.stringify(error, null, 2), - ); + const checkMessage = (message: string): boolean => + message.includes("Quota exceeded for quota metric 'Gemini") && + message.includes("Pro Requests'"); if (typeof error === 'string') { return checkMessage(error); -- cgit v1.2.3