You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
create_new_file writes a JSON file on one line when the model sends its contents as a JSON value #13363
Continue version: 2.0.0 (also checked on main at 5522c6f)
IDE version: VS Code 1.141.0
Model: Qwen3.6-Coder 35B, served locally through an OpenAI-compatible API (provider openai)
Description
When a model sends the contents of a new .json file as a JSON value instead of a string, create_new_file writes the file on a single line, for example:
A package.json or tsconfig.json written like this is valid, but nobody would write it that way, and every later edit produces a large diff.
Cause: createNewFileImpl reads the contents with getStringArg, which turns an object back into text with JSON.stringify(value). That compact form is right for other string arguments (and is what the existing tests expect), but for the contents of a file, indented JSON (JSON.stringify(value, null, 2)) is what the model meant.
To reproduce
Call createNewFileImpl({ filepath: "app/package.json", contents: { name: "app", private: true } }, extras): the file is written as {"name":"app","private":true}.
Activity