fix(telemetry): Prevent duplicate StartSessionEvent logging (#12090)

This commit is contained in:
Sandy Tao
2025-10-27 13:40:03 -07:00
committed by GitHub
parent abd22a753d
commit 6db64aab2b
4 changed files with 32 additions and 26 deletions
-18
View File
@@ -25,8 +25,6 @@ import {
} from '../core/contentGenerator.js';
import { GeminiClient } from '../core/client.js';
import { GitService } from '../services/gitService.js';
import { ClearcutLogger } from '../telemetry/clearcut-logger/clearcut-logger.js';
import { ShellTool } from '../tools/shell.js';
import { ReadFileTool } from '../tools/read-file.js';
import { GrepTool } from '../tools/grep.js';
@@ -180,10 +178,6 @@ describe('Server Config (config.ts)', () => {
beforeEach(() => {
// Reset mocks if necessary
vi.clearAllMocks();
vi.spyOn(
ClearcutLogger.prototype,
'logStartSessionEvent',
).mockImplementation(() => undefined);
});
describe('initialize', () => {
@@ -432,18 +426,6 @@ describe('Server Config (config.ts)', () => {
expect(config.getUsageStatisticsEnabled()).toBe(enabled);
},
);
it('logs the session start event', async () => {
const config = new Config({
...baseParams,
usageStatisticsEnabled: true,
});
await config.refreshAuth(AuthType.USE_GEMINI);
expect(
ClearcutLogger.prototype.logStartSessionEvent,
).toHaveBeenCalledOnce();
});
});
describe('Telemetry Settings', () => {