From 4fd42a8461a32ebdea25efa8a5ef89e17934a902 Mon Sep 17 00:00:00 2001 From: DarkSky <25152247+darkskygit@users.noreply.github.com> Date: Thu, 3 Jul 2025 12:32:45 +0800 Subject: [PATCH] fix(server): model mistakenly thinks the edit failed (#12997) fix AI-288 --- packages/backend/server/src/plugins/copilot/tools/doc-edit.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend/server/src/plugins/copilot/tools/doc-edit.ts b/packages/backend/server/src/plugins/copilot/tools/doc-edit.ts index 1520fcdec5..68022db3fb 100644 --- a/packages/backend/server/src/plugins/copilot/tools/doc-edit.ts +++ b/packages/backend/server/src/plugins/copilot/tools/doc-edit.ts @@ -28,7 +28,7 @@ export const createDocEditTool = ( ) => { return tool({ description: - "Use this tool to propose an edit to an existing doc.\n\nThis will be read by a less intelligent model, which will quickly apply the edit. You should make it clear what the edit is, while also minimizing the unchanged code you write.\nWhen writing the edit, you should specify each edit in sequence, with the special comment // ... existing code ... to represent unchanged code in between edited lines.\n\nYou should bias towards repeating as few lines of the original doc as possible to convey the change.\nEach edit should contain sufficient context of unchanged lines around the code you're editing to resolve ambiguity.\nIf you plan on deleting a section, you must provide surrounding context to indicate the deletion.\nDO NOT omit spans of pre-existing code without using the // ... existing code ... comment to indicate its absence.\n\nYou should specify the following arguments before the others: [target_id], [origin_content]", + "Use this tool to propose an edit to an existing doc. Each of your edit will only be applied to the document after the user’s approval. This tool will return a preview of your edit as applied to the document.\n\nThis will be read by a less intelligent model, which will quickly apply the edit. You should make it clear what the edit is, while also minimizing the unchanged code you write.\nWhen writing the edit, you should specify each edit in sequence, with the special comment // ... existing code ... to represent unchanged code in between edited lines.\n\nYou should bias towards repeating as few lines of the original doc as possible to convey the change.\nEach edit should contain sufficient context of unchanged lines around the code you're editing to resolve ambiguity.\nIf you plan on deleting a section, you must provide surrounding context to indicate the deletion.\nDO NOT omit spans of pre-existing code without using the // ... existing code ... comment to indicate its absence.\n\nYou should specify the following arguments before the others: [target_id], [origin_content]", parameters: z.object({ doc_id: z .string()