anomalyco / anomalyco/opencode

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

Open
#44,415 0 comments 0 reactions 1 assignee View on GitHub

@Brendonovich is already working on this.

Since Aug 23, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.