builtin_create_new_file tool doesn't create missing folders and exceptions are not propagated to LLM
Before submitting your bug report
- [x] I believe this is a bug. I'll try to join the Continue Discord for questions
- [x] I'm not able to find an open issue that reports the same bug
- [x] I've seen the troubleshooting guide on the Continue Docs
Relevant environment info
- OS: Macos
- Continue version: 1.0.8
- IDE version: IntelliJ
- Model: sonnet 3.7
Description
builtin_create_new_file tool doesn't create folders so tool fails if agent wants to create file in non existing folder. Every failing tool invocation is big problem in agentic mode for Anthropic models since continue dev is silently eating tool exceptions and not sending them back to LLM
To reproduce
In Agent mode write something like:
create new file in jokes/first.txt with random joke
if jokes folder won't exist then this operation would fail which is very problematic for Sonnet model since continue dev is not sending tool results failures back to LLM so every next call in given conversation will fail with
{"type":"error","error":{"type":"invalid_request_error","message":"messages.16: `tool_use` ids were found without `tool_result` blocks immediately after: toolu_019KXfAnAG2KHfxUYHYHKDxB. Each `tool_use` block must have a corresponding `tool_result` block in the next message."}}
Log output
Error handling message of type writeFile: java.io.FileNotFoundException: /Users/someone/IdeaProjects/something/jokes/first.txt (No such file or directory)
This issue hasn't been updated in 90 days and will be closed after an additional 10 days without activity. If it's still important, please leave a comment and share any new information that would help us address the issue.
it is important
This issue hasn't been updated in 90 days and will be closed after an additional 10 days without activity. If it's still important, please leave a comment and share any new information that would help us address the issue.
This issue was closed because it wasn't updated for 10 days after being marked stale. If it's still important, please reopen + comment and we'll gladly take another look!