anomalyco / anomalyco/opencode

Desktop v1.18.23 freezes when opening session review diff on large files (renderer unresponsive)

Open
#44,918 1 comment 0 reactions 1 assignee View on GitHub

@Brendonovich is already working on this.

Since Aug 25, 2026.

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

Description

Description

I hit a reproducible hang in OpenCode Desktop 1.18.23 on Windows. When I open
the review / file preview diff for a session that changed a large file, the
whole window locks up for minutes and sometimes the renderer process dies.

I debugged this myself using opencode together with the Ox Alpha model. We went
through the exported debug bundle and found the exact code path. Summary first,
details below.

WHAT HAPPENS

Every time I open the diff preview, the renderer main thread blocks inside a
synchronous line diff. Electron logs "renderer unresponsive", then the window
dies or I have to kill it. This happened three times today across separate app
restarts (runs 12:45, 12:47, 13:12 local time), same stack every time.

Stack captured by the unresponsive-samples hook in window.log:

execEditLength
LineDiff.diffWithOptionsObj
LineDiff.diff
diffLines
structuredPatch
createTwoFilesPatch
parseDiffFromFile
fileDiffFromContent / fileDiffFromPatch
resolveFileDiff
normalize            <- createMemo
SessionReviewFilePreviewV2

In one run the freeze ended like this after about two minutes:

render process gone { reason: 'killed', exitCode: 1 }
renderer process gone { ... }

There is also a matching crashpad dump in the bundle, so memory pressure is
likely part of it too.

WHY IT HANGS

SessionReviewFilePreviewV2 computes the file diff synchronously on the UI
thread inside a SolidJS memo. jsdiff's diffLines uses the Myers algorithm,
which is O(n*m) in time and memory for line counts n and m. On a big changed
file that means minutes of blocked main thread. The window stops painting,
Electron flags it unresponsive, and eventually the process gets killed.

The files involved are ordinary project files that happen to be huge, for
example an append-heavy worklog.md of a few MB or a package-lock.json that an
agent added mid-session. Nothing exotic about them; the problem is computing
the diff inline instead of off-thread.

EXPECTED BEHAVIOR

The UI should stay responsive. Large diffs should either be computed off the
main thread or skipped with a "diff too large to display" placeholder.

ENVIRONMENT

App version: 1.18.23 (packaged desktop, win32 x64)
Electron 42.3.3 / Chrome 148.0.7778.218 / Node 24.15.0
Windows 10, Build 19045.6466, x64

Debug bundle generated via the built-in "export debug logs" flow.

Minor extra observation from the same bundle: the renderer logs
"[global-sdk] event stream failed [object Object]" once on every startup. The
stream reconnects fine, but the error object is being stringified badly, so
whatever fails there is invisible in logs. Worth fixing the logging at least.

Plugins

No response

OpenCode version

1.18.23 (packaged desktop, win32 x64)

Steps to reproduce
  1. Have a session where the agent edits a multi-MB text file.
  2. Open the session, switch to the review / diff preview for that file.
  3. Window freezes immediately. ResizeObserver error spam starts. After a
    couple of minutes either it recovers or the renderer gets killed.
Screenshot and/or share link

No response

Operating System

Windows 10 Build 19045.6466

Terminal

Electron App

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.