diff --git a/gui/src/redux/thunks/handleApplyStateUpdate.ts b/gui/src/redux/thunks/handleApplyStateUpdate.ts index f5f5adc71..1cc2c35d0 100644 --- a/gui/src/redux/thunks/handleApplyStateUpdate.ts +++ b/gui/src/redux/thunks/handleApplyStateUpdate.ts @@ -83,43 +83,44 @@ export const handleApplyStateUpdate = createAsyncThunk< } if (accepted) { - // Add autoformatting diff to tool output if present - if (applyState.autoFormattingDiff) { - dispatch( - updateToolCallOutput({ - toolCallId: applyState.toolCallId, - contextItems: [ - { - icon: "info", - name: "Auto-formatting Applied", - description: "Editor auto-formatting changes", - content: `Along with your edits, the editor applied the following auto-formatting:\n\n${applyState.autoFormattingDiff}\n\n(Note: Pay close attention to changes such as single quotes being converted to double quotes, semicolons being removed or added, long lines being broken into multiple lines, adjusting indentation style, adding/removing trailing commas, etc. This will help you ensure future SEARCH/REPLACE operations to this file are accurate.)`, - hidden: false, - }, - ], - }), - ); - } - if (toolCallState.status !== "errored") { dispatch( acceptToolCall({ toolCallId: applyState.toolCallId, }), ); - dispatch( - updateToolCallOutput({ - toolCallId: applyState.toolCallId, - contextItems: [ - { - name: "Edit Success", - content: `Successfully edited ${applyState.filepath}`, - description: "", - hidden: true, - }, - ], - }), - ); + + // Add autoformatting diff to tool output if present + if (applyState.autoFormattingDiff) { + dispatch( + updateToolCallOutput({ + toolCallId: applyState.toolCallId, + contextItems: [ + { + icon: "info", + name: "Auto-formatting Applied", + description: "Editor auto-formatting changes", + content: `Along with your edits, the editor applied the following auto-formatting:\n\n${applyState.autoFormattingDiff}\n\n(Note: Pay close attention to changes such as single quotes being converted to double quotes, semicolons being removed or added, long lines being broken into multiple lines, adjusting indentation style, adding/removing trailing commas, etc. This will help you ensure future SEARCH/REPLACE operations to this file are accurate.)`, + hidden: false, + }, + ], + }), + ); + } else { + dispatch( + updateToolCallOutput({ + toolCallId: applyState.toolCallId, + contextItems: [ + { + name: "Edit Success", + content: `Successfully edited ${applyState.filepath}`, + description: "", + hidden: true, + }, + ], + }), + ); + } } else { dispatch( updateToolCallOutput({