mirror of
https://github.com/OpenHands/OpenHands.git
synced 2026-10-07 17:08:34 +08:00
fix: rename frontend conversation start telemetry (#16269)
Co-authored-by: openhands <openhands@all-hands.dev>
This commit is contained in:
co-authored by
openhands
parent
e9e52f3976
commit
eb14d6abdf
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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-"),
|
||||
|
||||
Reference in New Issue
Block a user