From 1211eefbdd82027b1ea65bb674de2289cce7a4e6 Mon Sep 17 00:00:00 2001 From: LE Quoc Dat Date: Mon, 28 Jul 2025 23:47:08 +0200 Subject: [PATCH] more guide, and edit_tool grind preference --- backend/agent/prompt.py | 11 +++++++---- backend/agent/sample_responses/1.txt | 1 - backend/agent/tools/sb_files_tool.py | 9 +-------- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/backend/agent/prompt.py b/backend/agent/prompt.py index 2e092f70..c9bddc9d 100644 --- a/backend/agent/prompt.py +++ b/backend/agent/prompt.py @@ -242,9 +242,8 @@ You have the abilixwty to execute operations using both Python and CLI tools: 1. Provide a clear, natural language `instructions` parameter describing the change (e.g., "I am adding error handling to the login function"). 2. Provide the `code_edit` parameter showing the exact changes, using `// ... existing code ...` to represent unchanged parts of the file. This keeps your request concise and focused. - **Examples:** - - **Adding a feature:** Your `code_edit` would show the new code block surrounded by `// ... existing code ...`. - - **Correcting a typo:** Your `code_edit` would show the line with the typo, and then the corrected line, surrounded by `// ... existing code ...`. - - **Rewriting a section:** Your `code_edit` would contain the entire new section, surrounded by `// ... existing code ...`. + - **Update todo.md:** Write down only checked boxes, like simply "[x] Add some content and styling" + - **Improve a large file:** Your `code_edit` would show the changes efficiently while skipping unchanged parts. - The `edit_file` tool is your ONLY tool for changing files. You MUST use `edit_file` for ALL modifications to existing files. It is more powerful and reliable than any other method. Using other tools for file modification is strictly forbidden. # 4. DATA PROCESSING & EXTRACTION @@ -726,7 +725,11 @@ Before implementing any configuration changes, ALWAYS ask detailed questions to You are Suna, and you can now evolve and adapt based on user needs. When someone asks you to gain new capabilities or connect to services, proactively use these tools to enhance yourself. You're not just following instructions - you're actively improving your own abilities to better serve your users. -Remember: You maintain all your core Suna capabilities while gaining the power to extend and customize yourself. This makes you more helpful and adaptable to each user's specific needs. ALWAYS use the `edit_file` tool to make changes to files. +Remember: You maintain all your core Suna capabilities while gaining the power to extend and customize yourself. This makes you more helpful and adaptable to each user's specific needs. ALWAYS use the `edit_file` tool to make changes to files. The `edit_file` tool is smart enough to find and replace the specific parts you mention, so you should: +1. **Show only the exact lines that change** +2. **Use `// ... existing code ...` for context when needed** +3. **Never reproduce entire files or large unchanged sections** + """ diff --git a/backend/agent/sample_responses/1.txt b/backend/agent/sample_responses/1.txt index 94d7e189..b146cc60 100644 --- a/backend/agent/sample_responses/1.txt +++ b/backend/agent/sample_responses/1.txt @@ -662,7 +662,6 @@ Let's update our todo list to mark the testing as complete: I am marking all tasks in the 'Testing' section of my todo list as complete. // ... existing code ... -## Testing - [x] Test game mechanics - [x] Test collision detection - [x] Test scoring diff --git a/backend/agent/tools/sb_files_tool.py b/backend/agent/tools/sb_files_tool.py index 152a5cc5..f60954bd 100644 --- a/backend/agent/tools/sb_files_tool.py +++ b/backend/agent/tools/sb_files_tool.py @@ -476,20 +476,13 @@ class SandboxFilesTool(SandboxToolsBase): todo.md I am marking the research and setup tasks as complete in my todo list. -# Project Plan - -## Research +// ... existing code ... - [x] Research topic A - [ ] Research topic B - [x] Research topic C - // ... existing code ... - -## Setup - [x] Setup database - [x] Configure server -- [ ] Deploy to staging - // ... existing code ...