File tree Expand file tree Collapse file tree 3 files changed +28
-2
lines changed
Expand file tree Collapse file tree 3 files changed +28
-2
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ import { ProxyAgent, setGlobalDispatcher } from 'undici';
4343import { DEFAULT_GEMINI_FLASH_MODEL } from '../config/models.js' ;
4444import { LoopDetectionService } from '../services/loopDetectionService.js' ;
4545import { ideContext } from '../services/ideContext.js' ;
46- import { ClearcutLogger } from '../telemetry/clearcut-logger/clearcut-logger .js' ;
46+ import { logFlashDecidedToContinue } from '../telemetry/loggers .js' ;
4747import { FlashDecidedToContinueEvent } from '../telemetry/types.js' ;
4848
4949function isThinkingSupported ( model : string ) {
@@ -388,7 +388,8 @@ export class GeminiClient {
388388 signal ,
389389 ) ;
390390 if ( nextSpeakerCheck ?. next_speaker === 'model' ) {
391- ClearcutLogger . getInstance ( this . config ) ?. logFlashDecidedToContinueEvent (
391+ logFlashDecidedToContinue (
392+ this . config ,
392393 new FlashDecidedToContinueEvent ( prompt_id ) ,
393394 ) ;
394395 const nextRequest = [ { text : 'Please continue.' } ] ;
Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ export const EVENT_API_ERROR = 'gemini_cli.api_error';
1313export const EVENT_API_RESPONSE = 'gemini_cli.api_response' ;
1414export const EVENT_CLI_CONFIG = 'gemini_cli.config' ;
1515export const EVENT_FLASH_FALLBACK = 'gemini_cli.flash_fallback' ;
16+ export const EVENT_FLASH_DECIDED_TO_CONTINUE =
17+ 'gemini_cli.flash_decided_to_continue' ;
1618
1719export const METRIC_TOOL_CALL_COUNT = 'gemini_cli.tool.call.count' ;
1820export const METRIC_TOOL_CALL_LATENCY = 'gemini_cli.tool.call.latency' ;
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import {
1515 EVENT_TOOL_CALL ,
1616 EVENT_USER_PROMPT ,
1717 EVENT_FLASH_FALLBACK ,
18+ EVENT_FLASH_DECIDED_TO_CONTINUE ,
1819 SERVICE_NAME ,
1920} from './constants.js' ;
2021import {
@@ -25,6 +26,7 @@ import {
2526 ToolCallEvent ,
2627 UserPromptEvent ,
2728 FlashFallbackEvent ,
29+ FlashDecidedToContinueEvent ,
2830 LoopDetectedEvent ,
2931} from './types.js' ;
3032import {
@@ -309,3 +311,24 @@ export function logLoopDetected(
309311 } ;
310312 logger . emit ( logRecord ) ;
311313}
314+
315+ export function logFlashDecidedToContinue (
316+ config : Config ,
317+ event : FlashDecidedToContinueEvent ,
318+ ) : void {
319+ ClearcutLogger . getInstance ( config ) ?. logFlashDecidedToContinueEvent ( event ) ;
320+ if ( ! isTelemetrySdkInitialized ( ) ) return ;
321+
322+ const attributes : LogAttributes = {
323+ ...getCommonAttributes ( config ) ,
324+ ...event ,
325+ 'event.name' : EVENT_FLASH_DECIDED_TO_CONTINUE ,
326+ } ;
327+
328+ const logger = logs . getLogger ( SERVICE_NAME ) ;
329+ const logRecord : LogRecord = {
330+ body : `Flash decided to continue.` ,
331+ attributes,
332+ } ;
333+ logger . emit ( logRecord ) ;
334+ }
You can’t perform that action at this time.
0 commit comments