Changesets · Branches · Tags · Compare
| Changeset | b058a03c043dd98fa845517bb30c4b33bb15f7a89f9d91134b1059e63eff08c4 |
|---|---|
| Author | Nate <sestinj@gmail.com> · 2025-08-28 19:48 -07:00 |
| Committer | Nate <sestinj@gmail.com> · 2025-08-28 19:48 -07:00 |
| Parents | a84763de5f60 |
1 file changed
modified extensions/cli/src/commands/serve.helpers.ts +3 −9
| @@ -58,7 +58,9 @@ | ||
| 58 | 58 | } |
| 59 | 59 | }, |
| 60 | 60 | 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 | |
| 62 | 64 | if (toolName) { |
| 63 | 65 | // Find and update the corresponding tool call state |
| 64 | 66 | for (let i = state.session.history.length - 1; i >= 0; i--) { |
| @@ -71,19 +73,11 @@ | ||
| 71 | 73 | ); |
| 72 | 74 | if (toolState) { |
| 73 | 75 | // Only update the status, not the output |
| 74 | - // The error message is already added as a separate tool result message | |
| 75 | - // by handleToolCalls/preprocessStreamedToolCalls | |
| 76 | 76 | toolState.status = "errored"; |
| 77 | 77 | break; |
| 78 | 78 | } |
| 79 | 79 | } |
| 80 | 80 | } |
| 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 | - }); | |
| 87 | 81 | } |
| 88 | 82 | }, |
| 89 | 83 | onToolPermissionRequest: ( |