From b443b5e800ec3ab20aacfca759229b3939abcaeb Mon Sep 17 00:00:00 2001 From: Jerop Kipruto Date: Mon, 23 Jun 2025 18:05:02 -0400 Subject: Ensure telemetry events are flushed immediately (#1344) The previous implementation used `flushIfNeeded` to batch most telemetry events, but it was not reliably sending them, leading to data loss. Notably, the `startSession` event, which already used `flushToClearcut`, was working correctly, indicating an issue with the batching logic itself. This change replaces all calls to `flushIfNeeded` with `flushToClearcut` to align all event logging with the working `startSession` implementation and ensure that events are sent immediately. This prioritizes the reliability of data collection over network efficiency. This is a temporary solution to prevent further data loss. The underlying issue with the batching mechanism in `flushIfNeeded` should be investigated and fixed in the future, at which point this change can be reverted. --- packages/cli/src/ui/hooks/useToolScheduler.test.ts | 1 + 1 file changed, 1 insertion(+) (limited to 'packages/cli/src/ui/hooks/useToolScheduler.test.ts') diff --git a/packages/cli/src/ui/hooks/useToolScheduler.test.ts b/packages/cli/src/ui/hooks/useToolScheduler.test.ts index 69d72cdc..1bc9e6be 100644 --- a/packages/cli/src/ui/hooks/useToolScheduler.test.ts +++ b/packages/cli/src/ui/hooks/useToolScheduler.test.ts @@ -49,6 +49,7 @@ const mockConfig = { getToolRegistry: vi.fn(() => mockToolRegistry as unknown as ToolRegistry), getApprovalMode: vi.fn(() => ApprovalMode.DEFAULT), getUsageStatisticsEnabled: () => true, + getDebugMode: () => false, }; const mockTool: Tool = { -- cgit v1.2.3