Skip to content

The opencode Desktop UI freezes for approximately 10–12 seconds when rendering file diffs. #31195

Closed as not planned

Description

@bytenios

Description

The opencode Desktop UI freezes for approximately 10–12 seconds when rendering file diffs. During the freeze the window becomes unresponsive and the OS may show a "not responding" warning.

To Reproduce

  1. Open a session with a file diff visible in the conversation (e.g., after a tool edit or a write operation)
  2. The UI freezes for ~10–12 seconds
  3. The window recovers on its own

Expected behavior

The UI should remain responsive. Diff rendering should be asynchronous or yield to the event loop so the renderer does not block.

Stack trace (from window.log)

renderer unresponsive { window: 'main', currentURL: 'oc://renderer/index.html' }
renderer responsive { window: 'main', currentURL: 'oc://renderer/index.html' }
renderer unresponsive samples (12 samples)

    at execEditLength (oc://renderer/assets/main-EPcHbCKO.js:42291:7)
    at LineDiff.diffWithOptionsObj (oc://renderer/assets/main-EPcHbCKO.js:42340:21)
    at LineDiff.diff (oc://renderer/assets/main-EPcHbCKO.js:42261:17)
    at diffLines (oc://renderer/assets/main-EPcHbCKO.js:42491:19)
    at structuredPatch (oc://renderer/assets/main-EPcHbCKO.js:42529:35)
    at createTwoFilesPatch (oc://renderer/assets/main-EPcHbCKO.js:42656:22)
    at parseDiffFromFile (oc://renderer/assets/main-EPcHbCKO.js:44283:32)
    at fileDiffFromContent (oc://renderer/assets/session-CGwfdNgW.js:18980:10)
    at fileDiffFromPatch (oc://renderer/assets/session-CGwfdNgW.js:18914:28)
    at resolveFileDiff (oc://renderer/assets/session-CGwfdNgW.js:18884:47)

The call chain shows a synchronous diff computation (execEditLength → structuredPatch → createTwoFilesPatch) that blocks the SolidJS reactive graph, freezing the UI.

Additional context

The freeze is consistently reproducible when viewing diffs. The diff library being used appears to compute the LCS/edit distance synchronously on the main thread without yielding. Potential mitigations:

  1. Offload large diffs to a Web Worker or use requestIdleCallback
  2. Virtualize or truncate very large diffs
  3. Use a streaming diff implementation that yields periodically

Plugins

No response

OpenCode version

1.16.2

Steps to reproduce

When I type a question, when I open OpenCode Desktop, or out of nowhere, OpenCode freezes for about 10 or 15 seconds.

Screenshot and/or share link

No response

Operating System

Windows 11 x64

Terminal

No response

Activity

  1. github-actions commented on Jun 7, 2026

    @github-actions
    Contributor

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

    Please check whether your issue is already covered by those reports, and consider adding your observations there if so.

  2. github-actions commented on Aug 7, 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