Elffuss BraidHub

kikocis/continue public

removed toolCallCompleted message
Changeset451a09bc47259e694b1105fa17fdcbefecc5787bf983672896f2dcb123ed5a37
Authoradarshramiyer <adarsh.r.iyer@gmail.com> · 2025-07-01 10:47 -07:00
Committeradarshramiyer <adarsh.r.iyer@gmail.com> · 2025-07-01 10:47 -07:00
Parents707bce180eb3

Browse the files at this changeset

5 files changed

modified core/core.ts +0 −6
@@ -821,12 +821,6 @@
821821 codeBaseIndexer: this.codeBaseIndexer,
822822 });
823823
824- this.messenger.send("toolCallCompleted", {
825- toolCallId: toolCall.id,
826- contextItems: result.contextItems,
827- succeeded: !result.errorMessage,
828- });
829-
830824 return result;
831825 }
832826
modified core/protocol/webview.ts +0 −4
@@ -43,9 +43,5 @@
4343 "jetbrains/setColors": [Record<string, string | null | undefined>, void];
4444 sessionUpdate: [{ sessionInfo: ControlPlaneSessionInfo | undefined }, void];
4545 toolCallPartialOutput: [{ toolCallId: string; contextItems: any[] }, void];
46- toolCallCompleted: [
47- { toolCallId: string; contextItems: any[]; succeeded: boolean },
48- void,
49- ];
5046 freeTrialExceeded: [undefined, void];
5147 };
modified core/tools/callTool.ts +23 −0
@@ -1,5 +1,6 @@
11 import { ContextItem, Tool, ToolCall, ToolExtras } from "..";
22 import { MCPManagerSingleton } from "../context/mcp/MCPManagerSingleton";
3+import { DataLogger } from "../data/log";
34 import { canParseUrl } from "../util/url";
45 import { BuiltInToolNames } from "./builtIn";
56
@@ -169,6 +170,26 @@
169170 }
170171 }
171172
173+function logToolUsage(
174+ toolCall: ToolCall,
175+ args: Record<string, any>,
176+ contextItems: ContextItem[],
177+ success: boolean,
178+) {
179+ void DataLogger.getInstance().logDevData({
180+ name: "toolUsage",
181+ data: {
182+ toolCallId: toolCall.id,
183+ functionName: toolCall.function.name,
184+ functionArgs: toolCall.function.arguments,
185+ toolCallArgs: args,
186+ parsedArgs: args,
187+ output: contextItems,
188+ succeeded: success,
189+ },
190+ });
191+}
192+
172193 // Handles calls for core/non-client tools
173194 // Returns an error context item if the tool call fails
174195 // Note: Edit tool is handled on client
@@ -190,6 +211,7 @@
190211 item.icon = tool.faviconUrl;
191212 });
192213 }
214+ logToolUsage(toolCall, args, contextItems, true);
193215 return {
194216 contextItems,
195217 errorMessage: undefined,
@@ -199,6 +221,7 @@
199221 if (e instanceof Error) {
200222 errorMessage = e.message;
201223 }
224+ logToolUsage(toolCall, {}, [], false);
202225 return {
203226 contextItems: [],
204227 errorMessage,
modified gui/src/hooks/ParallelListeners.tsx +0 −29
@@ -27,13 +27,10 @@
2727 import { exitEdit } from "../redux/thunks/edit";
2828 import { streamResponseAfterToolCall } from "../redux/thunks/streamResponseAfterToolCall";
2929
30-import { safeParseToolCallArgs } from "core/tools/parseArgs";
31-import { store } from "../redux/store";
3230 import { cancelStream } from "../redux/thunks/cancelStream";
3331 import { refreshSessionMetadata } from "../redux/thunks/session";
3432 import { streamResponseThunk } from "../redux/thunks/streamResponse";
3533 import { updateFileSymbolsFromHistory } from "../redux/thunks/updateFileSymbols";
36-import { findToolCall } from "../redux/util";
3734 import {
3835 setDocumentStylesFromLocalStorage,
3936 setDocumentStylesFromTheme,
@@ -288,32 +285,6 @@
288285 [currentToolCallApplyState, history],
289286 );
290287
291- useWebviewListener(
292- "toolCallCompleted",
293- async (data) => {
294- const state = store.getState();
295- const toolCallState = findToolCall(
296- state.session.history,
297- data.toolCallId,
298- );
299- if (toolCallState) {
300- ideMessenger.post("devdata/log", {
301- name: "toolUsage",
302- data: {
303- toolCallId: toolCallState.toolCallId,
304- functionName: toolCallState.toolCall.function.name,
305- functionArgs: toolCallState.toolCall.function.arguments,
306- toolCallArgs: safeParseToolCallArgs(toolCallState.toolCall),
307- parsedArgs: toolCallState.parsedArgs,
308- output: data.contextItems,
309- succeeded: data.succeeded,
310- },
311- });
312- }
313- },
314- [ideMessenger, store],
315- );
316-
317288 useEffect(() => {
318289 if (!isInEdit) {
319290 dispatch(setLastNonEditSessionEmpty(history.length === 0));
modified gui/src/redux/thunks/callCurrentTool.ts +2 −0
@@ -107,6 +107,7 @@
107107 }),
108108 );
109109
110+ console.log("logging Tool from callCurrentTool");
110111 logToolUsage(toolCallState, false, extra.ideMessenger, output);
111112 } else if (output?.length) {
112113 dispatch(
@@ -116,6 +117,7 @@
116117 }),
117118 );
118119
120+ console.log("logging Tool from callCurrentTool");
119121 logToolUsage(toolCallState, true, extra.ideMessenger, output);
120122 }
121123