Changesets · Branches · Tags · Compare
| Changeset | 496718a3e289f7b8afbf8dd7cac0ea121c7c2766bc17d18bc604e378ab6fa11a |
|---|---|
| Author | adarshramiyer <adarsh.r.iyer@gmail.com> · 2025-07-02 19:49 -07:00 |
| Committer | adarshramiyer <adarsh.r.iyer@gmail.com> · 2025-07-02 19:49 -07:00 |
| Parents | 8d995509008e |
4 files changed
modified gui/src/components/mainInput/Lump/LumpToolbar/LumpToolbar.tsx +5 −1
| @@ -1,9 +1,11 @@ | ||
| 1 | -import { useEffect } from "react"; | |
| 1 | +import { useContext, useEffect } from "react"; | |
| 2 | 2 | import { useSelector } from "react-redux"; |
| 3 | +import { IdeMessengerContext } from "../../../../context/IdeMessenger"; | |
| 3 | 4 | import { useAppDispatch, useAppSelector } from "../../../../redux/hooks"; |
| 4 | 5 | import { selectCurrentToolCall } from "../../../../redux/selectors/selectCurrentToolCall"; |
| 5 | 6 | import { cancelToolCall } from "../../../../redux/slices/sessionSlice"; |
| 6 | 7 | import { callCurrentTool } from "../../../../redux/thunks/callCurrentTool"; |
| 8 | +import { logToolUsage } from "../../../../redux/util"; | |
| 7 | 9 | import { isJetBrains } from "../../../../util"; |
| 8 | 10 | import { BlockSettingsTopToolbar } from "./BlockSettingsTopToolbar"; |
| 9 | 11 | import { EditOutcomeToolbar } from "./EditOutcomeToolbar"; |
| @@ -50,6 +52,8 @@ | ||
| 50 | 52 | } else if ((jetbrains ? altKey : metaKey) && event.key === "Backspace") { |
| 51 | 53 | event.preventDefault(); |
| 52 | 54 | event.stopPropagation(); |
| 55 | + const ideMessenger = useContext(IdeMessengerContext); | |
| 56 | + logToolUsage(toolCallState, false, true, ideMessenger); | |
| 53 | 57 | void dispatch( |
| 54 | 58 | cancelToolCall({ |
| 55 | 59 | toolCallId: toolCallState.toolCallId, |
modified gui/src/hooks/ParallelListeners.tsx +1 −1
| @@ -264,7 +264,7 @@ | ||
| 264 | 264 | state.toolCallId!, |
| 265 | 265 | ); |
| 266 | 266 | if (toolCallState) { |
| 267 | - logToolUsage(toolCallState, true, true); | |
| 267 | + logToolUsage(toolCallState, true, true, ideMessenger); | |
| 268 | 268 | } |
| 269 | 269 | void dispatch(exitEdit({})); |
| 270 | 270 | } |
modified gui/src/redux/thunks/callCurrentTool.ts +2 −2
| @@ -123,14 +123,14 @@ | ||
| 123 | 123 | |
| 124 | 124 | if (streamResponse) { |
| 125 | 125 | if (errorMessage) { |
| 126 | - logToolUsage(toolCallState, false, false, output); | |
| 126 | + logToolUsage(toolCallState, false, false, extra.ideMessenger, output); | |
| 127 | 127 | dispatch( |
| 128 | 128 | errorToolCall({ |
| 129 | 129 | toolCallId, |
| 130 | 130 | }), |
| 131 | 131 | ); |
| 132 | 132 | } else { |
| 133 | - logToolUsage(toolCallState, true, true, output); | |
| 133 | + logToolUsage(toolCallState, true, true, extra.ideMessenger, output); | |
| 134 | 134 | dispatch( |
| 135 | 135 | acceptToolCall({ |
| 136 | 136 | toolCallId, |
modified gui/src/redux/util/index.ts +3 −2
| @@ -1,5 +1,5 @@ | ||
| 1 | 1 | import { ContextItem, ToolCallState } from "core"; |
| 2 | -import { DataLogger } from "core/data/log"; | |
| 2 | +import { IIdeMessenger } from "../../context/IdeMessenger"; | |
| 3 | 3 | import { ChatHistoryItemWithMessageId } from "../slices/sessionSlice"; |
| 4 | 4 | import { RootState } from "../store"; |
| 5 | 5 | |
| @@ -33,9 +33,10 @@ | ||
| 33 | 33 | toolCallState: ToolCallState, |
| 34 | 34 | accepted: boolean, |
| 35 | 35 | success: boolean, |
| 36 | + messenger: IIdeMessenger, | |
| 36 | 37 | finalOutput?: ContextItem[], |
| 37 | 38 | ) { |
| 38 | - void DataLogger.getInstance().logDevData({ | |
| 39 | + messenger.post("devdata/log", { | |
| 39 | 40 | name: "toolUsage", |
| 40 | 41 | data: { |
| 41 | 42 | toolCallId: toolCallState.toolCallId, |