Skip to content

[Desktop] Renderer process locks up on session diff preview (diffLines in SessionReviewFilePreviewV2) #44415

Closed as not planned

Description

@Gringo2

Environment

  • App Version: 1.18.21 (Desktop packaged)
  • OS / Platform: Linux x86_64
  • Electron Version: 42.3.3
  • Node Version: 24.15.0

Description of the Bug

The OpenCode desktop application renderer thread locks up and freezes/crashes when opening or rendering session review file diff previews (SessionReviewFilePreviewV2).

Because JS line diffing (diffLines) is executed synchronously within the main UI renderer process, processing large file diffs blocks the event loop, resulting in [error] (window) renderer unresponsive and crashing the application window.

Stack Trace / Debug Logs

Extracted from window.log when sampling the unresponsive renderer process:

[error] (window) renderer unresponsive samples
    at execEditLength (oc://renderer/assets/main-DxX1DkV8.js:28907:7)
    at LineDiff.diffWithOptionsObj (oc://renderer/assets/main-DxX1DkV8.js:28956:21)
    at LineDiff.diff (oc://renderer/assets/main-DxX1DkV8.js:28877:17)
    at diffLines (oc://renderer/assets/main-DxX1DkV8.js:29107:19)
    at structuredPatch (oc://renderer/assets/main-DxX1DkV8.js:29149:35)
    at createTwoFilesPatch (oc://renderer/assets/main-DxX1DkV8.js:29279:22)
    at parseDiffFromFile (oc://renderer/assets/main-DxX1DkV8.js:29306:32)
    at fileDiffFromContent (oc://renderer/assets/main-DxX1DkV8.js:135468:10)
    at fileDiffFromPatch (oc://renderer/assets/main-DxX1DkV8.js:135402:28)
    at resolveFileDiff (oc://renderer/assets/main-DxX1DkV8.js:135372:47)
    at SessionReviewFilePreviewV2 (oc://renderer/assets/main-DxX1DkV8.js:148874:16)

Steps to Reproduce

  1. Run a session in OpenCode that creates or modifies large files.
  2. Open the Session Review tab / file diff preview (SessionReviewFilePreviewV2).
  3. The renderer thread locks up synchronously in diffLines, causing Electron to register renderer unresponsive and hang/crash.

Proposed Fix / Enhancement

  • Offload diff generation (diffLines / createTwoFilesPatch) from the UI thread to a Web Worker or compute it server-side.
  • Add size/line limits to truncate diff generation for large files before passing to the UI.

Activity

  1. thdxr commented on Oct 11, 2026

    @thdxr
    Member

    Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.

    — from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

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