From 0fbd3fe842df9e51bb312a4bf65362bd888a1712 Mon Sep 17 00:00:00 2001 From: "dayuan.jiang" Date: Sun, 14 Dec 2025 12:33:47 +0900 Subject: [PATCH] docs: fix append_diagram instructions for consistency - Change 'Do NOT include' to 'Do NOT start with' (clearer intent) - Add to prohibited start patterns - Change 'closing tags ' to just '' (wrapWithMxFile handles the rest) --- app/api/chat/route.ts | 4 ++-- components/chat-panel.tsx | 4 ++-- lib/system-prompts.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/api/chat/route.ts b/app/api/chat/route.ts index 9d06327..19e5560 100644 --- a/app/api/chat/route.ts +++ b/app/api/chat/route.ts @@ -444,9 +444,9 @@ IMPORTANT: Keep edits concise: WHEN TO USE: Only call this tool after display_diagram was truncated (you'll see an error message about truncation). CRITICAL INSTRUCTIONS: -1. Do NOT include or tags - they already exist in the partial +1. Do NOT start with , , or - they already exist in the partial 2. Continue from EXACTLY where your previous output stopped -3. Generate the remaining XML including closing tags +3. End with the closing tag to complete the diagram 4. If still truncated, call append_diagram again with the next fragment Example: If previous output ended with '...' and complete the remaining elements.`, diff --git a/components/chat-panel.tsx b/components/chat-panel.tsx index f21f939..1fbb601 100644 --- a/components/chat-panel.tsx +++ b/components/chat-panel.tsx @@ -244,9 +244,9 @@ ${partialEnding} \`\`\` NEXT STEP: Call append_diagram with the continuation XML. -- Do NOT include or tags +- Do NOT start with , , or (they already exist) - Start from EXACTLY where you stopped -- Continue until complete with `, +- End with the closing tag to complete the diagram`, }) return } diff --git a/lib/system-prompts.ts b/lib/system-prompts.ts index e99ac96..d878acb 100644 --- a/lib/system-prompts.ts +++ b/lib/system-prompts.ts @@ -186,9 +186,9 @@ const EXTENDED_ADDITIONS = ` **WHEN TO USE:** Only call this tool when display_diagram output was truncated (you'll see an error message about truncation). **CRITICAL RULES:** -1. Do NOT include , , or - they already exist in the partial +1. Do NOT start with , , or - they already exist in the partial 2. Continue from EXACTLY where your previous output stopped -3. Generate the remaining XML including closing tags +3. End with the closing tag to complete the diagram 4. If still truncated, call append_diagram again with the next fragment **Example:** If previous output ended with \`...\` and complete the remaining elements.