Elffuss BraidHub

kikocis/continue public

fix: don't add system message on tool call errors in serve
Changesetb058a03c043dd98fa845517bb30c4b33bb15f7a89f9d91134b1059e63eff08c4
AuthorNate <sestinj@gmail.com> · 2025-08-28 19:48 -07:00
CommitterNate <sestinj@gmail.com> · 2025-08-28 19:48 -07:00
Parentsa84763de5f60

Browse the files at this changeset

1 file changed

modified extensions/cli/src/commands/serve.helpers.ts +3 −9
@@ -58,7 +58,9 @@
5858 }
5959 },
6060 onToolError: (error: string, toolName?: string) => {
61- // Update the tool call state to errored status
61+ // Only update the tool call state to errored status when tool name is provided
62+ // The error message is already added as a separate tool result message
63+ // by handleToolCalls/preprocessStreamedToolCalls/executeStreamedToolCalls
6264 if (toolName) {
6365 // Find and update the corresponding tool call state
6466 for (let i = state.session.history.length - 1; i >= 0; i--) {
@@ -71,19 +73,11 @@
7173 );
7274 if (toolState) {
7375 // Only update the status, not the output
74- // The error message is already added as a separate tool result message
75- // by handleToolCalls/preprocessStreamedToolCalls
7676 toolState.status = "errored";
7777 break;
7878 }
7979 }
8080 }
81- } else {
82- // Generic error message when no tool name is provided
83- state.session.history.push({
84- message: { role: "system", content: error },
85- contextItems: [],
86- });
8781 }
8882 },
8983 onToolPermissionRequest: (