anomalyco / anomalyco/opencode

[Desktop] Pasting a large HTML block into a new session freezes the app, renderer is OOM-killed and forces relaunch

Open
#46,392 2 comments 0 reactions 1 assignee View on GitHub

@Hona is already working on this.

Since Aug 31, 2026.

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

Description

Description

OpenCode Desktop freezes completely after pasting a large block of HTML (a full rendered page source) into the prompt of a brand-new tab/session. The UI becomes unresponsive, and after a while a dialog appears asking to relaunch the app. Debug export confirms the renderer process was killed by an out-of-memory condition (render-process-gone with reason: 'oom').

Expected: the app should handle large pastes gracefully — e.g. truncate with a notice, virtualize/lazy-render, or debounce syntax highlighting — never freeze and crash the whole window.

Environment

  • OpenCode Desktop **

opencode-debug-20260831T110653.zip

** (packaged), Windows 11 x64

  • Electron 42.3.3 / Chrome 148.0.7778.218 (from debug bundle manifest.json)
  • Date of incident: 2026-08-31, session log dir desktop/20260831T073703

Log evidence (from debug export)

Renderer killed by OOM — desktop/20260831T073703/window.log:

[2026-08-31 14:06:15.318] [error] (window) app render process gone {
  url: 'oc://renderer/index.html',
  details: { reason: 'oom', exitCode: -536870904 }
}

(exitCode -536870904 = 0xE0000008)

Heavy layout-thrash storm right after the paste — renderer.log shows ~243
ResizeObserver loop completed with undelivered notifications errors, with the
densest burst running 13:46:47 → 13:47:33 (~140 events, one every ~200ms,
nonstop for ~46s) — consistent with the editor/message view re-measuring and
re-rendering the pasted content in a loop until memory exhaustion.

Meanwhile main.log shows the main process completely healthy (only routine
updater ticks) and the sidecar exited cleanly (code: 0) — so this is isolated
to the renderer/UI layer, not the server or the LLM stream.

Timeline: paste ≈ 13:46–13:47 → UI frozen (render thrash) → renderer OOM-killed at 14:06:15 → relaunch prompt; fresh session starts at 14:06:18.

Suspected cause

The composer / message renderer has no input-size guard: a very large paste is
fully inserted and processed by the editor (syntax highlighting, line
tokenization, ResizeObserver-driven re-layout of the oversized DOM), pushing the
renderer past its memory limit until Chromium kills it.

Suggested fixes (any of these would prevent the crash)

  • Cap paste size in the composer (e.g. warn/truncate beyond N KB, offer "attach as file" instead).
  • Virtualize rendering of oversized composer content; don't highlight/measure the whole paste at once.
  • Debounce/chunk syntax highlighting for large buffers, or disable highlighting above a size threshold.
  • Treat render-process-gone with reason: 'oom' defensively (already shows relaunch — good — but the underlying ballooning should be prevented).

Attachments

Debug bundle: opencode-debug-20260831T110653.zip (exported from the app right after the incident). Can attach on request.

Plugins

ponytail

OpenCode version

1.18.25

Steps to reproduce
  1. Open OpenCode Desktop on Windows.
  2. Open a new tab (new session).
  3. Paste a large HTML page (several hundred KB of markup) into the composer input.
  4. App freezes; after some time the "relaunch" dialog appears.
Screenshot and/or share link

No response

Operating System

Windows 11

Terminal

No response

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.