π OpenHands: AI-Driven Development
fix: rename frontend conversation start telemetry (#16269)
Rohit Malhotraeb14d6abdf76
diff --git a/__tests__/hooks/mutation/use-new-conversation-command.test.tsx b/__tests__/hooks/mutation/use-new-conversation-command.test.tsxindex bd5aa3283a..7bdfb9b1b4 100644--- a/__tests__/hooks/mutation/use-new-conversation-command.test.tsx+++ b/__tests__/hooks/mutation/use-new-conversation-command.test.tsx@@ -137,9 +137,10 @@ describe("useNewConversationCommand", () => {app_conversation_id: null,});- vi.spyOn(AgentServerConversationService, "createConversation").mockResolvedValue(- errorTask as never,- );+ vi.spyOn(+ AgentServerConversationService,+ "createConversation",+ ).mockResolvedValue(errorTask as never);const { result } = renderHook(() => useNewConversationCommand(), {wrapper,@@ -155,9 +156,10 @@ describe("useNewConversationCommand", () => {app_conversation_id: null,});- vi.spyOn(AgentServerConversationService, "createConversation").mockResolvedValue(- workingTask as never,- );+ vi.spyOn(+ AgentServerConversationService,+ "createConversation",+ ).mockResolvedValue(workingTask as never);const { result } = renderHook(() => useNewConversationCommand(), {wrapper,@@ -175,9 +177,10 @@ describe("useNewConversationCommand", () => {it("invalidates conversation list queries on success", async () => {const readyTask = makeStartTask();- vi.spyOn(AgentServerConversationService, "createConversation").mockResolvedValue(- readyTask as never,- );+ vi.spyOn(+ AgentServerConversationService,+ "createConversation",+ ).mockResolvedValue(readyTask as never);const invalidateSpy = vi.spyOn(queryClient, "invalidateQueries");@@ -230,9 +233,10 @@ describe("useNewConversationCommand", () => {it("shows a loading toast and dismisses it on success", async () => {const readyTask = makeStartTask();- vi.spyOn(AgentServerConversationService, "createConversation").mockResolvedValue(- readyTask as never,- );+ vi.spyOn(+ AgentServerConversationService,+ "createConversation",+ ).mockResolvedValue(readyTask as never);const { result } = renderHook(() => useNewConversationCommand(), {wrapper,@@ -249,7 +253,7 @@ describe("useNewConversationCommand", () => {});});- it("emits conversation_created on success with the /new no-context payload", async () => {+ it("emits conversation_start_requested on success with the /new no-context payload", async () => {const readyTask = makeStartTask();vi.spyOn(AgentServerConversationService,@@ -264,7 +268,7 @@ describe("useNewConversationCommand", () => {await waitFor(() => {expect(captureMock).toHaveBeenCalledWith(- "conversation_created",+ "conversation_start_requested",expect.objectContaining({conversation_id: "new-conv-999",task_id: "task-789",diff --git a/__tests__/hooks/use-tracking.test.ts b/__tests__/hooks/use-tracking.test.tsindex 137310fd3e..9ce89e22bd 100644--- a/__tests__/hooks/use-tracking.test.ts+++ b/__tests__/hooks/use-tracking.test.ts@@ -69,7 +69,7 @@ describe("useTracking", () => {});describe("trackConversationCreated", () => {- it("captures conversation_created with full metadata for a repository, task-start conversation", () => {+ it("captures conversation_start_requested with full metadata for a repository, task-start conversation", () => {getTracking().trackConversationCreated({conversationId: "task-abc123",taskId: "abc123",@@ -81,7 +81,7 @@ describe("useTracking", () => {entryPoint: "sidebar_cloud_menu",});- expect(captureMock).toHaveBeenCalledWith("conversation_created", {+ expect(captureMock).toHaveBeenCalledWith("conversation_start_requested", {conversation_id: "task-abc123",task_id: "abc123",// task-prefixed conversation_id => cloud sandbox still provisioning@@ -98,7 +98,7 @@ describe("useTracking", () => {});});- it("captures conversation_created for a local workspace start with no repository", () => {+ it("captures conversation_start_requested for a local workspace start with no repository", () => {getTracking().trackConversationCreated({conversationId: "conv-1",taskId: "conv-1",@@ -110,7 +110,7 @@ describe("useTracking", () => {entryPoint: "sidebar_local_menu",});- expect(captureMock).toHaveBeenCalledWith("conversation_created", {+ expect(captureMock).toHaveBeenCalledWith("conversation_start_requested", {conversation_id: "conv-1",task_id: "conv-1",// real conversation_id => ready immediately (local)@@ -140,7 +140,7 @@ describe("useTracking", () => {});expect(captureMock).toHaveBeenCalledWith(- "conversation_created",+ "conversation_start_requested",expect.objectContaining({agent_type: "plan",has_parent_conversation: true,@@ -180,7 +180,7 @@ describe("useTracking", () => {}),);expect(captureMock).toHaveBeenCalledWith(- "conversation_created",+ "conversation_start_requested",expect.not.objectContaining({agent_server_version: "1.36.2",automation_sdk_version: "1.36.3",diff --git a/src/hooks/use-tracking.ts b/src/hooks/use-tracking.tsindex 6d6b30d2e0..6103e3f73f 100644--- a/src/hooks/use-tracking.ts+++ b/src/hooks/use-tracking.ts@@ -82,7 +82,7 @@ export const useTracking = () => {hasParentConversation: boolean;entryPoint?: string;}) => {- track("conversation_created", {+ track("conversation_start_requested", {conversation_id: conversationId,task_id: taskId,is_start_task: conversationId.startsWith("task-"),