fix: edit output overridden

This commit is contained in:
Dallin Romney 2025-09-11 13:36:19 -07:00
parent 5512dd696d
commit 381b8a0bf8

View file

@ -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({