Skip to content

UI freezes indefinitely when patching large Python files in large projects #16115

Closed as not planned

Description

@JayZenith

Description

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.

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

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    perfIndicates a performance issue or need for optimization
    on Mar 5, 2026
  2. github-actions commented on Mar 5, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    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.

  3. 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
  4. h4rvey-g commented on Mar 19, 2026

    @h4rvey-g

    Same issue. One temp workaround is to ask agent to "retry editing in smaller patches"

  5. AlejandroBaron commented on Mar 26, 2026

    @AlejandroBaron

    I get the same issue, disabling LSP servers worked for me, both pyright and pylance show this problem

  6. assigned and unassigned on Apr 26, 2026
  7. removed
    bugSomething isn't working
    perfIndicates a performance issue or need for optimization
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  8. github-actions commented on Jul 5, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions