summaryrefslogtreecommitdiff
path: root/packages/cli/src
diff options
context:
space:
mode:
authorJerop Kipruto <[email protected]>2025-06-23 18:05:02 -0400
committerGitHub <[email protected]>2025-06-23 22:05:02 +0000
commitb443b5e800ec3ab20aacfca759229b3939abcaeb (patch)
tree7f94b1bf7d31351b87c9fad40c4e1009450ee67a /packages/cli/src
parent58572a6eaab903a94402d4d9fa56e16b354d5330 (diff)
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.
Diffstat (limited to 'packages/cli/src')
-rw-r--r--packages/cli/src/ui/hooks/useGeminiStream.test.tsx1
-rw-r--r--packages/cli/src/ui/hooks/useToolScheduler.test.ts1
2 files changed, 2 insertions, 0 deletions
diff --git a/packages/cli/src/ui/hooks/useGeminiStream.test.tsx b/packages/cli/src/ui/hooks/useGeminiStream.test.tsx
index c5145eda..29871e8a 100644
--- a/packages/cli/src/ui/hooks/useGeminiStream.test.tsx
+++ b/packages/cli/src/ui/hooks/useGeminiStream.test.tsx
@@ -289,6 +289,7 @@ describe('useGeminiStream', () => {
getCheckpointingEnabled: vi.fn(() => false),
getGeminiClient: mockGetGeminiClient,
getUsageStatisticsEnabled: () => true,
+ getDebugMode: () => false,
addHistory: vi.fn(),
} as unknown as Config;
mockOnDebugMessage = vi.fn();
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 = {