Edit: revised problem solving/bug fixing guidance to discourage common indentation-error prone methods.
deci committed
May 12, 2025 at 16:41 UTC
9d88264277fbd7b47af34e4bcef4600e43010bc9
1 file changed
+7
-1
prompts/default/agent.system.tool.code_exe.md
+7
-1
@@ -122,9 +122,15 @@ Execute commands and code for computation, data analysis, and file operations.
122
- For import errors, check dependencies and installation
123
- Reset sessions after errors before trying again
124
- Use try/except in Python code to handle potential errors
125
+- **If you encounter the same error twice with the same method, switch to a more reliable method (e.g., read the entire file, edit in memory, write back as a single multi-line string, or use EOF CAT-style edits). Document the fallback method used.**
126
127
### DEBUGGING
128
- Print absolute paths when verifying file creation
129
- List directory contents to check available files
130
- Create debugging scripts to test environment setup
130
-- Use explicit path variables for consistency
\ No newline at end of file
131
+- Use explicit path variables for consistency
132
+
133
+### CODE EDITING (PYTHON)
134
+- Avoid naive string or line replacements for code edits, especially in Python, as this can break indentation and structure.
135
+- Prefer reading the whole file, editing in memory, and writing back as a single multi-line string for reliability.
136
+- **If repeated edit failures occur, switch to EOF CAT-style edits or another robust method.**
\ No newline at end of file