summaryrefslogtreecommitdiff
path: root/packages/core/src/telemetry
diff options
context:
space:
mode:
authorSandy Tao <[email protected]>2025-07-23 22:37:28 -0700
committerGitHub <[email protected]>2025-07-24 05:37:28 +0000
commit0ef9c0b792f056015d0eee4486480c1f80015fc5 (patch)
treedd07e9c5c241362e0f8c395b3cbcedfe92abd736 /packages/core/src/telemetry
parent6380bfe35c80e71f6a43bc7b549e61561d675a07 (diff)
Log prompt id when a loop is detected (#4765)
Co-authored-by: N. Taylor Mullen <[email protected]>
Diffstat (limited to 'packages/core/src/telemetry')
-rw-r--r--packages/core/src/telemetry/clearcut-logger/clearcut-logger.ts4
-rw-r--r--packages/core/src/telemetry/types.ts4
2 files changed, 5 insertions, 3 deletions
diff --git a/packages/core/src/telemetry/clearcut-logger/clearcut-logger.ts b/packages/core/src/telemetry/clearcut-logger/clearcut-logger.ts
index ba47e7a0..d36a16b5 100644
--- a/packages/core/src/telemetry/clearcut-logger/clearcut-logger.ts
+++ b/packages/core/src/telemetry/clearcut-logger/clearcut-logger.ts
@@ -481,8 +481,8 @@ export class ClearcutLogger {
logLoopDetectedEvent(event: LoopDetectedEvent): void {
const data = [
{
- gemini_cli_key: EventMetadataKey.GEMINI_CLI_SESSION_ID,
- value: this.config?.getSessionId() ?? '',
+ gemini_cli_key: EventMetadataKey.GEMINI_CLI_PROMPT_ID,
+ value: JSON.stringify(event.prompt_id),
},
{
gemini_cli_key: EventMetadataKey.GEMINI_CLI_LOOP_DETECTED_TYPE,
diff --git a/packages/core/src/telemetry/types.ts b/packages/core/src/telemetry/types.ts
index 268457b5..69dffb08 100644
--- a/packages/core/src/telemetry/types.ts
+++ b/packages/core/src/telemetry/types.ts
@@ -256,11 +256,13 @@ export class LoopDetectedEvent {
'event.name': 'loop_detected';
'event.timestamp': string; // ISO 8601
loop_type: LoopType;
+ prompt_id: string;
- constructor(loop_type: LoopType) {
+ constructor(loop_type: LoopType, prompt_id: string) {
this['event.name'] = 'loop_detected';
this['event.timestamp'] = new Date().toISOString();
this.loop_type = loop_type;
+ this.prompt_id = prompt_id;
}
}