Description
Bug Report
Problem
The issue has been identified.It appeared after my update and likely originates from this commit (264418c):
fix(snapshot): complete gitignore respect for previously tracked files ([#22172]
Description
On Windows, when a worktree has many ignored files (e.g., 75,000+), the snapshot add() function fails with ENAMETOOLONG error. This happens because git check-ignore --no-index is called with all file paths as command-line arguments, exceeding Windows' 32KB command-line limit.
Cause Detail
In packages/opencode/src/snapshot/index.ts , the add(), patch(), and diffFull() functions call: git check-ignore --no-index -- ...
When there are many ignored files, the command line becomes too long for Windows.
Solution
Replace git check-ignore --no-index with local ignore library (already used elsewhere in the codebase at src/file/index.ts). The ignore library provides equivalent gitignore pattern matching without command-line length limits.
Plugins
No response
OpenCode version
No response
Steps to reproduce
No response
Screenshot and/or share link
No response
Operating System
No response
Terminal
No response
Description
Bug Report
Problem
The issue has been identified.It appeared after my update and likely originates from this commit (264418c):
fix(snapshot): complete gitignore respect for previously tracked files ([#22172]
Description
On Windows, when a worktree has many ignored files (e.g., 75,000+), the snapshot
add()function fails withENAMETOOLONGerror. This happens becausegit check-ignore --no-indexis called with all file paths as command-line arguments, exceeding Windows' 32KB command-line limit.Cause Detail
In packages/opencode/src/snapshot/index.ts , the add(), patch(), and diffFull() functions call: git check-ignore --no-index -- ...
When there are many ignored files, the command line becomes too long for Windows.
Solution
Replace
git check-ignore --no-indexwith localignorelibrary (already used elsewhere in the codebase atsrc/file/index.ts). Theignorelibrary provides equivalent gitignore pattern matching without command-line length limits.Plugins
No response
OpenCode version
No response
Steps to reproduce
No response
Screenshot and/or share link
No response
Operating System
No response
Terminal
No response