mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 16:57:46 +00:00
Log flash continue (#4700)
This commit is contained in:
@@ -13,6 +13,8 @@ export const EVENT_API_ERROR = 'gemini_cli.api_error';
|
||||
export const EVENT_API_RESPONSE = 'gemini_cli.api_response';
|
||||
export const EVENT_CLI_CONFIG = 'gemini_cli.config';
|
||||
export const EVENT_FLASH_FALLBACK = 'gemini_cli.flash_fallback';
|
||||
export const EVENT_FLASH_DECIDED_TO_CONTINUE =
|
||||
'gemini_cli.flash_decided_to_continue';
|
||||
|
||||
export const METRIC_TOOL_CALL_COUNT = 'gemini_cli.tool.call.count';
|
||||
export const METRIC_TOOL_CALL_LATENCY = 'gemini_cli.tool.call.latency';
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user