continue icon indicating copy to clipboard operation
continue copied to clipboard

builtin_create_new_file tool doesn't create missing folders and exceptions are not propagated to LLM

Open pczekaj opened this issue 8 months ago • 3 comments

Before submitting your bug report

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)

pczekaj avatar Apr 09 '25 10:04 pczekaj

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.

github-actions[bot] avatar Aug 06 '25 02:08 github-actions[bot]

it is important

vldF avatar Aug 11 '25 13:08 vldF

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.

github-actions[bot] avatar Nov 11 '25 02:11 github-actions[bot]

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!

github-actions[bot] avatar Nov 22 '25 02:11 github-actions[bot]