Changesets · Branches · Tags · Compare
| Changeset | 910f9a39164f88f98cbd21a557da7cb0130ac8952f3ea64b3bd04aadd3ef21b0 |
|---|---|
| Author | Nate <sestinj@gmail.com> · 2025-09-14 18:44 -07:00 |
| Committer | Nate <sestinj@gmail.com> · 2025-09-14 18:44 -07:00 |
| Parents | 9c8f3520bf15 |
1 file changed
modified gui/src/redux/thunks/streamResponse_toolCalls.test.ts +36 −22
| @@ -563,18 +563,25 @@ | ||
| 563 | 563 | expect(result.type).toBe("chat/streamResponse/fulfilled"); |
| 564 | 564 | |
| 565 | 565 | // Verify telemetry events for auto-approved tool execution |
| 566 | - expect(mockPosthog.capture).toHaveBeenCalledWith("gui_tool_call_decision", { | |
| 567 | - decision: "auto_accept", | |
| 568 | - toolName: "search_codebase", | |
| 569 | - toolCallId: "tool-call-1", | |
| 570 | - }); | |
| 566 | + // Use partial matching to allow additional fields (e.g. model) in payload | |
| 567 | + expect(mockPosthog.capture).toHaveBeenCalledWith( | |
| 568 | + "gui_tool_call_decision", | |
| 569 | + expect.objectContaining({ | |
| 570 | + decision: "auto_accept", | |
| 571 | + toolName: "search_codebase", | |
| 572 | + toolCallId: "tool-call-1", | |
| 573 | + }), | |
| 574 | + ); | |
| 571 | 575 | |
| 572 | - expect(mockPosthog.capture).toHaveBeenCalledWith("gui_tool_call_outcome", { | |
| 573 | - succeeded: true, | |
| 574 | - toolName: "search_codebase", | |
| 575 | - errorMessage: undefined, | |
| 576 | - duration_ms: expect.any(Number), | |
| 577 | - }); | |
| 576 | + expect(mockPosthog.capture).toHaveBeenCalledWith( | |
| 577 | + "gui_tool_call_outcome", | |
| 578 | + expect.objectContaining({ | |
| 579 | + succeeded: true, | |
| 580 | + toolName: "search_codebase", | |
| 581 | + errorMessage: undefined, | |
| 582 | + duration_ms: expect.any(Number), | |
| 583 | + }), | |
| 584 | + ); | |
| 578 | 585 | |
| 579 | 586 | // Verify final state after tool call execution |
| 580 | 587 | const finalState = mockStoreWithToolSettings.getState(); |
| @@ -2800,18 +2807,25 @@ | ||
| 2800 | 2807 | ]); |
| 2801 | 2808 | |
| 2802 | 2809 | // Verify telemetry events for manual approval flow |
| 2803 | - expect(mockPosthog.capture).toHaveBeenCalledWith("gui_tool_call_decision", { | |
| 2804 | - decision: "accept", | |
| 2805 | - toolName: "search_codebase", | |
| 2806 | - toolCallId: "tool-approval-flow-1", | |
| 2807 | - }); | |
| 2810 | + // Use partial matching to allow additional fields (e.g. model) in payload | |
| 2811 | + expect(mockPosthog.capture).toHaveBeenCalledWith( | |
| 2812 | + "gui_tool_call_decision", | |
| 2813 | + expect.objectContaining({ | |
| 2814 | + decision: "accept", | |
| 2815 | + toolName: "search_codebase", | |
| 2816 | + toolCallId: "tool-approval-flow-1", | |
| 2817 | + }), | |
| 2818 | + ); | |
| 2808 | 2819 | |
| 2809 | - expect(mockPosthog.capture).toHaveBeenCalledWith("gui_tool_call_outcome", { | |
| 2810 | - succeeded: true, | |
| 2811 | - toolName: "search_codebase", | |
| 2812 | - errorMessage: undefined, | |
| 2813 | - duration_ms: expect.any(Number), | |
| 2814 | - }); | |
| 2820 | + expect(mockPosthog.capture).toHaveBeenCalledWith( | |
| 2821 | + "gui_tool_call_outcome", | |
| 2822 | + expect.objectContaining({ | |
| 2823 | + succeeded: true, | |
| 2824 | + toolName: "search_codebase", | |
| 2825 | + errorMessage: undefined, | |
| 2826 | + duration_ms: expect.any(Number), | |
| 2827 | + }), | |
| 2828 | + ); | |
| 2815 | 2829 | |
| 2816 | 2830 | // Verify IDE messenger calls for tool execution |
| 2817 | 2831 | expect(mockIdeMessengerApproval.request).toHaveBeenCalledWith( |