From fdc5fd0f0ac6cf9e5c5f1def4bd4d55b4fb1c227 Mon Sep 17 00:00:00 2001 From: sharath <29162020+tnfssc@users.noreply.github.com> Date: Sat, 19 Jul 2025 02:12:40 +0000 Subject: [PATCH] fix(prompt): clarify usage of 'ask' tool and update completion instructions in prompt and message_tool descriptions --- backend/agent/prompt.py | 2 +- backend/agent/tools/message_tool.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/agent/prompt.py b/backend/agent/prompt.py index 4d14bfeb..41b133ad 100644 --- a/backend/agent/prompt.py +++ b/backend/agent/prompt.py @@ -576,7 +576,7 @@ For casual conversation and social interactions: * Attach all relevant files with the **'ask'** tool when asking a question related to them, or when delivering final results before completion. * Always include representable files as attachments when using 'ask' - this includes HTML files, presentations, writeups, visualizations, reports, and any other viewable content. * For any created files that can be viewed or presented (such as index.html, slides, documents, charts, etc.), always attach them to the 'ask' tool to ensure the user can immediately see the results. - * Share results and deliverables before entering complete state (use 'ask' with attachments as appropriate). + * Always share results and deliverables using 'ask' tool with attachments before entering complete state. Do not use 'complete' tool directly before using 'ask' tool. * Ensure users have access to all necessary resources. - Communication Tools Summary: diff --git a/backend/agent/tools/message_tool.py b/backend/agent/tools/message_tool.py index 6c216cab..eef3ef59 100644 --- a/backend/agent/tools/message_tool.py +++ b/backend/agent/tools/message_tool.py @@ -18,7 +18,7 @@ class MessageTool(Tool): "type": "function", "function": { "name": "ask", - "description": "Ask user a question and wait for response. Use for: 1) Requesting clarification on ambiguous requirements, 2) Seeking confirmation before proceeding with high-impact changes, 3) Gathering additional information needed to complete a task, 4) Offering options and requesting user preference, 5) Validating assumptions when critical to task success, 6) Call this tool when you finish your task, before calling the complete tool. IMPORTANT: Use this tool only when user input is essential to proceed. Always provide clear context and options when applicable. Include relevant attachments when the question relates to specific files or resources.", + "description": "Ask user a question and wait for response. Use for: 1) Requesting clarification on ambiguous requirements, 2) Seeking confirmation before proceeding with high-impact changes, 3) Gathering additional information needed to complete a task, 4) Offering options and requesting user preference, 5) Validating assumptions when critical to task success. IMPORTANT: Use this tool only when user input is essential to proceed. Always provide clear context and options when applicable. Include relevant attachments when the question relates to specific files or resources.", "parameters": { "type": "object", "properties": { @@ -217,7 +217,7 @@ If you encounter any issues or need to take additional steps, please let me know "type": "function", "function": { "name": "complete", - "description": "A special tool to indicate you have completed all tasks and are about to enter complete state. Use ONLY when: 1) All tasks in todo.md are marked complete [x], 2) The user's original request has been fully addressed, 3) There are no pending actions or follow-ups required, 4) You've delivered all final outputs and results to the user, 5) Use the ask tool to preview the results once before calling complete tool. IMPORTANT: This is the ONLY way to properly terminate execution. Never use this tool unless ALL tasks are complete and verified. Always ensure you've provided all necessary outputs and references before using this tool.", + "description": "A special tool to indicate you have completed all tasks and are about to enter complete state. Use ONLY when: 1) All tasks in todo.md are marked complete [x], 2) The user's original request has been fully addressed, 3) There are no pending actions or follow-ups required, 4) You've delivered all final outputs and results to the user. IMPORTANT: This is the ONLY way to properly terminate execution. Never use this tool unless ALL tasks are complete and verified. Always ensure you've provided all necessary outputs and references before using this tool.", "parameters": { "type": "object", "properties": {},