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
"step-end" diff calculation blocks event loop indefinitely with 100% cpu #29762
Whenever a tool call generates a large diff, opencode freezes, stuck on 100% CPU, the RSS increases by around 1GB, and the bun event loop gets blocked (one reason why it's hard to debug/profile) making opencode unusable. The rest of the symptoms are just by-product of a blocked event loop so I won't describe them all (basically TUI is responsive but you can't really do anything).
The root cause is the summary diff calculation after "step-end".
This can be easily recreated by doing a tool call that creates a full-file diff in a file that's smaller than 2 MB.
Plugins
None
OpenCode version
1.15.11
Steps to reproduce
Create an empty repo with the following generate.py script:
This script creates a file called foo.json which is under 2mb (otherwise diff is skipped)
2. Run the script to generate an initial foo.json
3. Start opencode and have your agent run the python script.
4. Once the tool call finishes, the agent will not continue it's turn. The TUI will not be blocked, but you can't stop the conversation with "escape", and the opencode process will be stuck on 100% CPU indefinitely.
This issue might be a duplicate of existing issues. Please check:
Memory Megathread #20695: Memory Megathread — this is the central tracking issue for memory and CPU spike problems. The maintainers are actively collecting heap snapshots there to diagnose these issues. Your reproducible example could be very valuable — consider sharing it there as well and uploading a heap snapshot following the instructions in that issue.
changed the title [-]Minutes of 100% CPU and 1gb+ memory spike during rebase merge conflict (with minimal example + root cause)[/-][+]Freeze for minutes with 100% CPU and 1gb+ memory spike during rebase merge conflict (with minimal example + root cause)[/+]on May 28, 2026
changed the title [-]Freeze for minutes with 100% CPU and 1gb+ memory spike during rebase merge conflict (with minimal example + root cause)[/-][+]"step-end" diff calculation blocks event loop indefinitely with 100% cpu[/+]on May 29, 2026
Activity
github-actions commentedon May 28, 2026
This issue might be a duplicate of existing issues. Please check:
[-]Minutes of 100% CPU and 1gb+ memory spike during rebase merge conflict (with minimal example + root cause)[/-][+]Freeze for minutes with 100% CPU and 1gb+ memory spike during rebase merge conflict (with minimal example + root cause)[/+][-]Freeze for minutes with 100% CPU and 1gb+ memory spike during rebase merge conflict (with minimal example + root cause)[/-][+]"step-end" diff calculation blocks event loop indefinitely with 100% cpu[/+]asaf92 commentedon May 29, 2026
Also related:
#20495
#23362
#29873
feat(v1.17.7): patched.6 — default-off per-boot project-copy refresh …
opencode: pin v1.17.7-patched.6 (step-end-diff-bound #29762 + default…
github-actions commentedon Jul 29, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.