Elffuss BraidHub

kikocis/continue public

added tool into ToolCallState on generation
Changeset73fcda533e5b9ebc18e0c543d1b3ab172d969b2d3b1e9c1502bcf0ae1aeaef9b
Authoradarshramiyer <adarsh.r.iyer@gmail.com> · 2025-07-02 16:07 -07:00
Committeradarshramiyer <adarsh.r.iyer@gmail.com> · 2025-07-02 16:07 -07:00
Parentsa0c996c3d18a

Browse the files at this changeset

7 files changed

modified core/index.d.ts +1 −0
@@ -443,6 +443,7 @@
443443 status: ToolStatus;
444444 parsedArgs: any;
445445 output?: ContextItem[];
446+ tool?: Tool;
446447 }
447448
448449 interface Reasoning {
modified core/tools/callTool.ts +0 −1
@@ -186,7 +186,6 @@
186186 functionName: toolCall.function.name,
187187 functionArgs: toolCall.function.arguments,
188188 toolCallArgs: args,
189- parsedArgs: args,
190189 output: contextItems,
191190 succeeded: success,
192191 },
modified gui/src/redux/slices/sessionSlice.ts +9 −0
@@ -18,6 +18,7 @@
1818 RuleWithSource,
1919 Session,
2020 SessionMetadata,
21+ Tool,
2122 } from "core";
2223 import { NEW_SESSION_TITLE } from "core/util/constants";
2324 import {
@@ -535,6 +536,7 @@
535536 state,
536537 action: PayloadAction<{
537538 toolCallId: string;
539+ tools: Tool[];
538540 }>,
539541 ) => {
540542 const toolCallState = findToolCall(
@@ -543,6 +545,13 @@
543545 );
544546 if (toolCallState) {
545547 toolCallState.status = "generated";
548+
549+ const tool = action.payload.tools.find(
550+ (t) => t.function.name === toolCallState.toolCall.function.name,
551+ );
552+ if (tool) {
553+ toolCallState.tool = tool;
554+ }
546555 }
547556 },
548557 updateToolCallOutput: (
modified gui/src/redux/thunks/streamNormalInput.ts +1 −0
@@ -154,6 +154,7 @@
154154 dispatch(
155155 setToolGenerated({
156156 toolCallId: toolCallState.toolCallId,
157+ tools: state.config.config.tools,
157158 }),
158159 );
159160
modified gui/src/redux/util/index.ts +0 −1
@@ -43,7 +43,6 @@
4343 functionName: toolCallState.toolCall?.function?.name,
4444 functionArgs: toolCallState.toolCall?.function?.arguments,
4545 toolCallArgs: safeParseToolCallArgs(toolCallState.toolCall),
46- parsedArgs: toolCallState.parsedArgs,
4746 output: finalOutput || toolCallState.output || [],
4847 succeeded: success,
4948 },
modified packages/config-yaml/src/schemas/data/toolUsage/index.ts +0 −1
@@ -6,7 +6,6 @@
66 functionName: z.string(),
77 functionArgs: z.string(),
88 toolCallArgs: z.any(),
9- parsedArgs: z.any(),
109 succeeded: z.boolean(),
1110 output: z.array(z.any()).optional(),
1211 });
modified packages/config-yaml/src/schemas/data/toolUsage/v0.2.0.ts +1 −2
@@ -14,7 +14,6 @@
1414 functionName: true,
1515 functionArgs: true,
1616 toolCallArgs: true,
17- parsedArgs: true,
1817 succeeded: true,
1918 output: true,
2019 });
@@ -22,6 +21,6 @@
2221 export const toolUsageEventSchema_0_2_0_noCode =
2322 toolUsageEventSchema_0_2_0.omit({
2423 functionArgs: true,
25- parsedArgs: true,
24+ toolCallArgs: true,
2625 output: true,
2726 });