diff --git a/gui/src/redux/thunks/callToolById.ts b/gui/src/redux/thunks/callToolById.ts index 30e136efb..cbf6801fc 100644 --- a/gui/src/redux/thunks/callToolById.ts +++ b/gui/src/redux/thunks/callToolById.ts @@ -46,7 +46,7 @@ export const callToolById = createAsyncThunk< const selectedChatModel = selectSelectedChatModel(state); - posthog.capture("gui_tool_call_decision", { + posthog.capture("tool_call_decision", { model: selectedChatModel, decision: isAutoApproved ? "auto_accept" : "accept", toolName: toolCallState.toolCall.function.name, @@ -135,7 +135,7 @@ export const callToolById = createAsyncThunk< // Capture telemetry for tool call execution outcome with duration const duration_ms = Date.now() - startTime; - posthog.capture("gui_tool_call_outcome", { + posthog.capture("tool_call_outcome", { model: selectedChatModel, succeeded: !error, toolName: toolCallState.toolCall.function.name, diff --git a/gui/src/redux/thunks/cancelToolCall.ts b/gui/src/redux/thunks/cancelToolCall.ts index 141ee3229..b532fe0bc 100644 --- a/gui/src/redux/thunks/cancelToolCall.ts +++ b/gui/src/redux/thunks/cancelToolCall.ts @@ -27,7 +27,7 @@ export const cancelToolCallThunk = createAsyncThunk< if (toolCallState) { // Track tool call rejection - posthog.capture("gui_tool_call_decision", { + posthog.capture("tool_call_decision", { model: selectedChatModel, decision: "reject", toolName: toolCallState.toolCall.function.name, diff --git a/gui/src/redux/thunks/streamResponse_toolCalls.test.ts b/gui/src/redux/thunks/streamResponse_toolCalls.test.ts index decf0b5f8..d3c1fda47 100644 --- a/gui/src/redux/thunks/streamResponse_toolCalls.test.ts +++ b/gui/src/redux/thunks/streamResponse_toolCalls.test.ts @@ -567,7 +567,7 @@ describe("streamResponseThunk - tool calls", () => { // Verify telemetry events for auto-approved tool execution // Use partial matching to allow additional fields (e.g. model) in payload expect(mockPosthog.capture).toHaveBeenCalledWith( - "gui_tool_call_decision", + "tool_call_decision", expect.objectContaining({ decision: "auto_accept", toolName: "search_codebase", @@ -576,11 +576,11 @@ describe("streamResponseThunk - tool calls", () => { ); expect(mockPosthog.capture).toHaveBeenCalledWith( - "gui_tool_call_outcome", + "tool_call_outcome", expect.objectContaining({ succeeded: true, toolName: "search_codebase", - errorMessage: undefined, + errorReason: undefined, duration_ms: expect.any(Number), }), ); @@ -2819,7 +2819,7 @@ describe("streamResponseThunk - tool calls", () => { // Verify telemetry events for manual approval flow // Use partial matching to allow additional fields (e.g. model) in payload expect(mockPosthog.capture).toHaveBeenCalledWith( - "gui_tool_call_decision", + "tool_call_decision", expect.objectContaining({ decision: "accept", toolName: "search_codebase", @@ -2828,11 +2828,11 @@ describe("streamResponseThunk - tool calls", () => { ); expect(mockPosthog.capture).toHaveBeenCalledWith( - "gui_tool_call_outcome", + "tool_call_outcome", expect.objectContaining({ succeeded: true, toolName: "search_codebase", - errorMessage: undefined, + errorReason: undefined, duration_ms: expect.any(Number), }), ); diff --git a/gui/src/util/clientTools/multiEditImpl.test.ts b/gui/src/util/clientTools/multiEditImpl.test.ts index 7c262cb82..dffd9ba01 100644 --- a/gui/src/util/clientTools/multiEditImpl.test.ts +++ b/gui/src/util/clientTools/multiEditImpl.test.ts @@ -58,9 +58,7 @@ describe("multiEditImpl", () => { it("should throw if edits array is empty", async () => { await expect( multiEditImpl({ filepath: "test.txt", edits: [] }, "id", mockExtras), - ).rejects.toThrow( - "edits array is required and must contain at least one edit", - ); + ).rejects.toThrow("edits array must contain at least one edit"); }); it("should throw if edit has invalid old_string", async () => {