mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-14 13:53:02 -07:00
feat(core): enhance loop detection with 2-stage check (#12902)
This commit is contained in:
@@ -48,6 +48,7 @@ import type {
|
||||
RecoveryAttemptEvent,
|
||||
WebFetchFallbackAttemptEvent,
|
||||
ExtensionUpdateEvent,
|
||||
LlmLoopCheckEvent,
|
||||
} from './types.js';
|
||||
import {
|
||||
recordApiErrorMetrics,
|
||||
@@ -654,3 +655,18 @@ export function logWebFetchFallbackAttempt(
|
||||
};
|
||||
logger.emit(logRecord);
|
||||
}
|
||||
|
||||
export function logLlmLoopCheck(
|
||||
config: Config,
|
||||
event: LlmLoopCheckEvent,
|
||||
): void {
|
||||
ClearcutLogger.getInstance(config)?.logLlmLoopCheckEvent(event);
|
||||
if (!isTelemetrySdkInitialized()) return;
|
||||
|
||||
const logger = logs.getLogger(SERVICE_NAME);
|
||||
const logRecord: LogRecord = {
|
||||
body: event.toLogBody(),
|
||||
attributes: event.toOpenTelemetryAttributes(config),
|
||||
};
|
||||
logger.emit(logRecord);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user