anomalyco / anomalyco/opencode
[Bug] Log rotation stops working on Windows; opencode.log grows indefinitely
@Hona is already working on this.
Since Sep 3, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
On Windows, OpenCode log rotation appears to stop working after some time. Instead of rotating recent logs, all new log output is appended to a single live opencode.log, which has grown to ~170 MB.
Observed log directory:
%USERPROFILE%.local\share\opencode\log\
opencode.log 170,851,996 B Sep 3 21:33
2026-06-10T124216.log 5,772 B Jun 10
2026-06-09T185008.log 7,341 B Jun 9
... 11 rotated files total, all from Jun 9-10
There have been many OpenCode sessions since June 10, but no newer rotated log files were created. opencode.log has continued growing instead.
This is particularly problematic when using --log-level DEBUG, because the live file can grow quickly and there is no bounded retention in practice.
Expected behavior
The live log should continue rotating according to OpenCode's normal log-retention policy, keeping the log directory bounded.
Actual behavior
Rotation stopped after June 10. Since then:
- no new rotated files are created;
- opencode.log keeps accumulating output across sessions;
- the current live log reached ~170 MB.
Plugins
No response
OpenCode version
1.3.14.0
Steps to reproduce
I do not yet have a minimal deterministic trigger, but the failure is persistent on this machine:
- Run OpenCode normally across multiple sessions on Windows.
- Inspect %USERPROFILE%.local\share\opencode\log.
- Observe that old rotated files remain unchanged while opencode.log continues growing across subsequent sessions.
- Running with opencode --log-level DEBUG increases the growth rate but is not required for the rotation failure.
Screenshot and/or share link
Additional observations
- The stale rotated files are all dated June 9–10.
- The current opencode.log was still actively written on Sep 3.
- This report is specifically about log rotation/retention; it is separate from any process-exit or memory-growth issue.
Operating System
Windows 11, build 10.0.26200.2.0.0
Terminal
PowerShell / Git Bash
Contributor 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.
Assessment
This issue has not been assessed yet.