|
|
@@ -375,8 +375,12 @@ export class ToolExecutor {
|
|
|
this.isPlanModeToolRestricted(block.name)
|
|
|
) {
|
|
|
const errorMessage = `Tool '${block.name}' is not available in PLAN MODE. This tool is restricted to ACT MODE for file modifications. Only use tools available for PLAN MODE when in that mode.`
|
|
|
+ await this.removeLastPartialMessageIfExistsWithType("say", "error")
|
|
|
await this.say("error", errorMessage)
|
|
|
- this.pushToolResult(formatResponse.toolError(errorMessage), block)
|
|
|
+ // Only push the final error message when the streaming is done.
|
|
|
+ if (!block.partial) {
|
|
|
+ this.pushToolResult(formatResponse.toolError(errorMessage), block)
|
|
|
+ }
|
|
|
return true
|
|
|
}
|
|
|
|