Log flash continue (#4700)

This commit is contained in:
Sandy Tao
2025-07-22 18:01:24 -07:00
committed by GitHub
parent 67008d4643
commit 7c3a84075d
3 changed files with 28 additions and 2 deletions

View File

@@ -15,6 +15,7 @@ import {
EVENT_TOOL_CALL,
EVENT_USER_PROMPT,
EVENT_FLASH_FALLBACK,
EVENT_FLASH_DECIDED_TO_CONTINUE,
SERVICE_NAME,
} from './constants.js';
import {
@@ -25,6 +26,7 @@ import {
ToolCallEvent,
UserPromptEvent,
FlashFallbackEvent,
FlashDecidedToContinueEvent,
LoopDetectedEvent,
} from './types.js';
import {
@@ -309,3 +311,24 @@ export function logLoopDetected(
};
logger.emit(logRecord);
}
export function logFlashDecidedToContinue(
config: Config,
event: FlashDecidedToContinueEvent,
): void {
ClearcutLogger.getInstance(config)?.logFlashDecidedToContinueEvent(event);
if (!isTelemetrySdkInitialized()) return;
const attributes: LogAttributes = {
...getCommonAttributes(config),
...event,
'event.name': EVENT_FLASH_DECIDED_TO_CONTINUE,
};
const logger = logs.getLogger(SERVICE_NAME);
const logRecord: LogRecord = {
body: `Flash decided to continue.`,
attributes,
};
logger.emit(logRecord);
}