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
UI freezes indefinitely when patching large Python files in large projects #16115
Opencode hangs on "Preparing patch..." indefinitely when editing large Python files inside large projects (reproduced with server_args.py ~255KB in the sglang repo).
pyright cold-starts and scans the entire project on every session, running at 100+ CPU. During that scan it stops draining its stdin socket. textDocument/didOpen sends the full file -- at 255KB this overflows the ~213KB kernel socket buffer. Both sides stall. No timeout, no recovery.
Confirmed with ss -xp: Recv-Q 219KB, Send-Q 224KB simultaneously. Doesn't reproduce when the file is isolated -- no pyproject.toml means no project scan, pyright drains the socket instantly.
If your issue is distinct (specifically the pipe buffer fill / blocked write scenario), it would help to add your OpenCode version and OS details to distinguish it from the above.
changed the title [-]UI freezes indefinitely when applying patches while pyright is CPU-saturated[/-][+]UI freezes indefinitely when patching large Python files in large projects[/+]on Mar 8, 2026
Activity
github-actions commentedon Mar 5, 2026
This issue might be a duplicate of existing issues. Please check:
apply_patchhanging due toLSP.touchFileblocking — same code path, though that issue focuses on sequential waiting while this one identifies the underlying pipe buffer overflow mechanismIf your issue is distinct (specifically the pipe buffer fill / blocked write scenario), it would help to add your OpenCode version and OS details to distinguish it from the above.
[-]UI freezes indefinitely when applying patches while pyright is CPU-saturated[/-][+]UI freezes indefinitely when patching large Python files in large projects[/+]h4rvey-g commentedon Mar 19, 2026
Same issue. One temp workaround is to ask agent to "retry editing in smaller patches"
AlejandroBaron commentedon Mar 26, 2026
I get the same issue, disabling LSP servers worked for me, both pyright and pylance show this problem
github-actions commentedon Jul 5, 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.