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 }}
Repository navigation
Line ending issue with fs/write_file in Opencode 2 #50740
In version 1, Opencode uses it's own editing capabilities which worked fine, while in version 2 it uses fs/write_file which messes line endings
My files have LF line endings. Let me quote the agent:
The `edit` tool inflated CRLF files with blank lines on repeated edits;
I restored from git and re-applied all 29 replacements via a newline-preserving script —
final diff is 70 insertions / 21 deletions across 9 files.
Worth keeping in mind for future edits on this repo.
Plugins
No response
OpenCode version
2.0.12
Steps to reproduce
My environment is a project on Windows with LF file line endings (so no default CRLF for Windows as it may be expected)
If your issue is specifically about fs/write_file in v2 behaving differently from v1, please clarify that distinction in the existing issues or confirm this is a new regression.
Activity
github-actions commentedon Sep 22, 2026
This issue might be a duplicate of existing issues. Please check:
If your issue is specifically about
fs/write_filein v2 behaving differently from v1, please clarify that distinction in the existing issues or confirm this is a new regression.klonuo commentedon Sep 22, 2026
Yes, issue is specifically about fs/write_file in v2 behaving differently from v1