mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-23 19:44:30 -07:00
fix(core): add telemetry support for smart edit correction events (#10378)
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
@@ -34,6 +34,8 @@ import { applyReplacement } from './edit.js';
|
||||
import { safeLiteralReplace } from '../utils/textUtils.js';
|
||||
import { SmartEditStrategyEvent } from '../telemetry/types.js';
|
||||
import { logSmartEditStrategy } from '../telemetry/loggers.js';
|
||||
import { SmartEditCorrectionEvent } from '../telemetry/types.js';
|
||||
import { logSmartEditCorrectionEvent } from '../telemetry/loggers.js';
|
||||
|
||||
interface ReplacementContext {
|
||||
params: EditToolParams;
|
||||
@@ -416,7 +418,10 @@ class EditToolInvocation implements ToolInvocation<EditToolParams, ToolResult> {
|
||||
);
|
||||
|
||||
if (secondError) {
|
||||
// The fix failed, return the original error
|
||||
// The fix failed, log failure and return the original error
|
||||
const event = new SmartEditCorrectionEvent('failure');
|
||||
logSmartEditCorrectionEvent(this.config, event);
|
||||
|
||||
return {
|
||||
currentContent,
|
||||
newContent: currentContent,
|
||||
@@ -427,6 +432,9 @@ class EditToolInvocation implements ToolInvocation<EditToolParams, ToolResult> {
|
||||
};
|
||||
}
|
||||
|
||||
const event = new SmartEditCorrectionEvent('success');
|
||||
logSmartEditCorrectionEvent(this.config, event);
|
||||
|
||||
return {
|
||||
currentContent,
|
||||
newContent: secondAttemptResult.newContent,
|
||||
|
||||
Reference in New Issue
Block a user