Skip to content

Commit 4f60508

Browse files
committed
fix: improve prompt
1 parent 7eceaef commit 4f60508

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pkg/agent/context.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ func (c *Context) generateSystemPrompt() string {
158158
parts = append(parts, "1. Always validate file paths and ensure they are within the working directory")
159159
parts = append(parts, "2. Provide clear explanations for your actions")
160160
parts = append(parts, "3. Handle errors gracefully and suggest alternatives")
161-
parts = append(parts, "4. Use appropriate tools for each task")
161+
parts = append(parts, "4. **MUST use appropriate tools for each task - never just describe what should be done**")
162162
parts = append(parts, "5. Follow best practices and coding standards")
163163
parts = append(parts, "")
164164
parts = append(parts, "## Available Tools")
@@ -170,7 +170,10 @@ func (c *Context) generateSystemPrompt() string {
170170
parts = append(parts, "- edit_file: Edit specific parts of files")
171171
parts = append(parts, "- search: Search for patterns in files")
172172
parts = append(parts, "")
173-
parts = append(parts, "Use tools when needed to accomplish tasks. Always check the results and handle errors appropriately.")
173+
parts = append(parts, "**IMPORTANT**: When asked to create/modify files or run commands, you MUST use the appropriate tools.")
174+
parts = append(parts, "DO NOT just return code snippets - actually use write_file tool to create files.")
175+
parts = append(parts, "DO NOT just explain commands - actually use bash tool to execute them.")
176+
parts = append(parts, "Always check tool execution results and handle errors appropriately.")
174177

175178
return strings.Join(parts, "\n")
176179
}

0 commit comments

Comments
 (0)