create_new_file writes a JSON file on one line when the model sends its contents as a JSON value
Maintainers usually reply within 8 days
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- devtools
Research direction
The bug is in createNewFileImpl, which reads contents through getStringArg; that helper runs JSON.stringify(value) on objects, which causes the one-line output. Start by reading getStringArg and how createNewFileImpl uses it, then reproduce with the call from the issue. Done means that object contents for a .json file is written as indented JSON (JSON.stringify(value, null, 2)), while other string arguments and the existing tests keep their compact behaviour.
Written by the indexing model from the issue text.
Description
Relevant environment info
- OS: macOS
- 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:
{"name":"app","version":"1.0.0","scripts":{"build":"tsc"},"devDependencies":{"typescript":"^5.6.0"}}
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}.
Log output
No response
- Dominant language
- TypeScript
- Stars
- 36.5k
- Forks
- 5.6k
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from continuedev/continue
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
continuedev/continue#13486 ·
Maintainers usually reply within 8 days
-
Chat panel overflows horizontally when VS Code zoom level is increased (Cmd/Ctrl + +)Possibly taken @tang-ontheway claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
continuedev/continue#13483 ·
Maintainers usually reply within 8 days
-
Docs: show tool selection for a shared remote MCP endpointPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
continuedev/continue#13464 · 1 comment ·
Maintainers usually reply within 8 days
-
Inline code becomes unreadable in VS Code high-contrast themesPossibly taken @aminesayagh claimed this 21 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 63/100
continuedev/continue#13424 ·
Maintainers usually reply within 8 days
-
Difficulty 1/5 Under an hour Newbie friendliness 66/100
continuedev/continue#13352 ·
Maintainers usually reply within 8 days
All issues in continuedev/continue
Similar issues
-
area-templates triage:bot-seen triage:needs-human
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
microsoft/aspire#22356 · 1 comment ·
Maintainers usually reply within 1 day
-
Archiving an agent that is not loaded keeps its old updatedAtPossibly taken @luoph claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
content triage
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
contributor: external needs review severity: low
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
Enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
JSPrismarine/JSPrismarine#3214 ·
Maintainers usually reply within 1 day