Elffuss BraidHub

kikocis/continue public

updated logToolUsage to use core "devdata/log" message
Changeset496718a3e289f7b8afbf8dd7cac0ea121c7c2766bc17d18bc604e378ab6fa11a
Authoradarshramiyer <adarsh.r.iyer@gmail.com> · 2025-07-02 19:49 -07:00
Committeradarshramiyer <adarsh.r.iyer@gmail.com> · 2025-07-02 19:49 -07:00
Parents8d995509008e

Browse the files at this changeset

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";
22 import { useSelector } from "react-redux";
3+import { IdeMessengerContext } from "../../../../context/IdeMessenger";
34 import { useAppDispatch, useAppSelector } from "../../../../redux/hooks";
45 import { selectCurrentToolCall } from "../../../../redux/selectors/selectCurrentToolCall";
56 import { cancelToolCall } from "../../../../redux/slices/sessionSlice";
67 import { callCurrentTool } from "../../../../redux/thunks/callCurrentTool";
8+import { logToolUsage } from "../../../../redux/util";
79 import { isJetBrains } from "../../../../util";
810 import { BlockSettingsTopToolbar } from "./BlockSettingsTopToolbar";
911 import { EditOutcomeToolbar } from "./EditOutcomeToolbar";
@@ -50,6 +52,8 @@
5052 } else if ((jetbrains ? altKey : metaKey) && event.key === "Backspace") {
5153 event.preventDefault();
5254 event.stopPropagation();
55+ const ideMessenger = useContext(IdeMessengerContext);
56+ logToolUsage(toolCallState, false, true, ideMessenger);
5357 void dispatch(
5458 cancelToolCall({
5559 toolCallId: toolCallState.toolCallId,
modified gui/src/hooks/ParallelListeners.tsx +1 −1
@@ -264,7 +264,7 @@
264264 state.toolCallId!,
265265 );
266266 if (toolCallState) {
267- logToolUsage(toolCallState, true, true);
267+ logToolUsage(toolCallState, true, true, ideMessenger);
268268 }
269269 void dispatch(exitEdit({}));
270270 }
modified gui/src/redux/thunks/callCurrentTool.ts +2 −2
@@ -123,14 +123,14 @@
123123
124124 if (streamResponse) {
125125 if (errorMessage) {
126- logToolUsage(toolCallState, false, false, output);
126+ logToolUsage(toolCallState, false, false, extra.ideMessenger, output);
127127 dispatch(
128128 errorToolCall({
129129 toolCallId,
130130 }),
131131 );
132132 } else {
133- logToolUsage(toolCallState, true, true, output);
133+ logToolUsage(toolCallState, true, true, extra.ideMessenger, output);
134134 dispatch(
135135 acceptToolCall({
136136 toolCallId,
modified gui/src/redux/util/index.ts +3 −2
@@ -1,5 +1,5 @@
11 import { ContextItem, ToolCallState } from "core";
2-import { DataLogger } from "core/data/log";
2+import { IIdeMessenger } from "../../context/IdeMessenger";
33 import { ChatHistoryItemWithMessageId } from "../slices/sessionSlice";
44 import { RootState } from "../store";
55
@@ -33,9 +33,10 @@
3333 toolCallState: ToolCallState,
3434 accepted: boolean,
3535 success: boolean,
36+ messenger: IIdeMessenger,
3637 finalOutput?: ContextItem[],
3738 ) {
38- void DataLogger.getInstance().logDevData({
39+ messenger.post("devdata/log", {
3940 name: "toolUsage",
4041 data: {
4142 toolCallId: toolCallState.toolCallId,