Log yolo mode + number of turns (#6055)

Co-authored-by: Shi Shu <shii@google.com>
This commit is contained in:
shishu314
2025-08-25 16:06:47 -04:00
committed by GitHub
parent f32a54fefc
commit cd75d94262
9 changed files with 103 additions and 2 deletions

View File

@@ -19,6 +19,7 @@ import {
EVENT_NEXT_SPEAKER_CHECK,
SERVICE_NAME,
EVENT_SLASH_COMMAND,
EVENT_CONVERSATION_FINISHED,
EVENT_CHAT_COMPRESSION,
EVENT_MALFORMED_JSON_RESPONSE,
} from './constants.js';
@@ -35,6 +36,7 @@ import {
NextSpeakerCheckEvent,
LoopDetectedEvent,
SlashCommandEvent,
ConversationFinishedEvent,
KittySequenceOverflowEvent,
ChatCompressionEvent,
MalformedJsonResponseEvent,
@@ -409,6 +411,27 @@ export function logIdeConnection(
logger.emit(logRecord);
}
export function logConversationFinishedEvent(
config: Config,
event: ConversationFinishedEvent,
): void {
ClearcutLogger.getInstance(config)?.logConversationFinishedEvent(event);
if (!isTelemetrySdkInitialized()) return;
const attributes: LogAttributes = {
...getCommonAttributes(config),
...event,
'event.name': EVENT_CONVERSATION_FINISHED,
};
const logger = logs.getLogger(SERVICE_NAME);
const logRecord: LogRecord = {
body: `Conversation finished.`,
attributes,
};
logger.emit(logRecord);
}
export function logChatCompression(
config: Config,
event: ChatCompressionEvent,