continue icon indicating copy to clipboard operation
continue copied to clipboard

Code writing to file failed

Open Omnls opened this issue 11 months ago • 3 comments

Before submitting your bug report

I have already tried running VS Code as an administrator.

Relevant environment info

- OS: windows 11
- Continue version: 1.2.11  and   1.3.24
- IDE version:
[Content]
版本: 1.106.3 (user setup)    
提交: bf9252a2fb45be6893dd8870c0bf37e2e1766d61
日期: 2025-11-25T22:28:18.024Z (1 周前)
Electron: 37.7.0
ElectronBuildId: 12781156
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Windows_NT x64 10.0.26200

- Model: cluaude sonnet 4.5
- config:
  

  
  OR link to agent in Continue hub:

Description

No response

To reproduce

create_new_file failed with the message: filepath argument is required and must not be empty or whitespace-only. (type string)

Please try something else or request further instructions.

Hi Continue Dev Team, I'm experiencing consistent issues with file operations in Continue Agent. Here are the specific problems: Issue 1: File Creation Failure When Agent attempts to create a new file, it fails with an empty filepath error: Continue tried to create hna-plus/OPTIMIZATION.md create_new_file failed with the message: filepath argument is required and must not be empty or whitespace-only. (type string) Expected behavior: Agent should create the file OPTIMIZATION.md in the hna-plus directory. Actual behavior: The filepath argument appears to be empty or invalid when passed to the creation function. Issue 2: Path Resolution Problems Agent struggles with Windows path formats, consistently failing with path-related errors: multi_edit failed: File c:/code/tamper/update-pages/ai-chat/script.user.js does not exist ls failed: Directory c:/code/tamper/update-pages/ai-chat not found. Make sure to use forward-slash paths Note: The file DOES exist at that location, but Agent cannot resolve the path correctly. Issue 3: File Size Limit When attempting to read large files: read_currently_open_file failed: File is too large (48704 tokens vs 16384 token limit) This is expected behavior, but Agent should have fallback strategies for handling large files. Workaround Found I've managed to partially mitigate these issues by optimizing the Rules prompts to guide Agent toward better file handling, but the problems still occur intermittently. Agent can sometimes create/read files successfully, but the failures are unpredictable. Environment Details OS: Windows (using paths like c:/code/...) File paths: Using forward slashes, but Agent still has resolution issues File operations affected: create_new_file, multi_edit, ls, read_currently_open_file Suggestions Filepath validation: Add better filepath argument validation before tool execution Path normalization: Implement robust Windows path handling (handle both C:\ and c:/ formats) Better error messages: Provide clearer feedback about which part of the path resolution failed Large file handling: Implement automatic chunking or alternative strategies for files exceeding token limits Impact This issue blocks basic file operations and significantly impacts productivity when working with Agent. Users need to manually create files or repeatedly retry operations. I see similar reports from other users on the forum. Please prioritize fixing these core file operation issues before adding new features. Request: Could you investigate the root cause of empty filepath arguments in the create_new_file tool call? Thank you for your attention to this matter.

Log output


Omnls avatar Dec 06 '25 03:12 Omnls

:tada: This issue has been resolved in version 1.9.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

sestinj avatar Jan 26 '26 06:01 sestinj

:tada: This issue has been resolved in version 1.40.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

sestinj avatar Jan 31 '26 23:01 sestinj

I am running to the same issue with version 1.2.24 of the Contiue.dev VSCode Extension, which is the latest version I can install. I've tested using MiniMax 3, Sonnet 4.6, and Haiku 4.5.

StL-Jim avatar Jun 19 '26 15:06 StL-Jim