Skip to content

Desktop crash: pasting ~270KB text into prompt hangs renderer (JSON.stringify on main thread) #51988

Closed as not planned

Description

@abchears

Summary

opencode Desktop hangs ("renderer unresponsive", then crash) when pasting a large text (~277 KB, ~1500 lines) into the chat prompt input in one go.

Environment

  • App: opencode Desktop 1.18.31 (packaged, win x64)
  • OS: Windows x64
  • Reporter: via Meta Muse Spark agent session

Repro

  1. Open opencode Desktop, start a session.
  2. Copy ~277 KB of plain text (in my case: 1503 lines / 276,765 bytes of Docker pull JSON progress log) and paste it into the prompt input at once.
  3. The renderer hangs almost immediately ("renderer unresponsive"), and the app has to be killed / crashes.

Evidence (from exported debug logs)

desktop/.../window.log captured the hang with stack samples, all inside the paste path:

[error] (window) renderer unresponsive { window: '...', currentURL: 'oc://renderer/index.html' }
...
at HTMLDivElement.onPaste (main-mfFBJ4oT.js:129605:66)
at HTMLDocument.eventHandler ...
at PromptInputV2._el$6.$$input ...
at Object.onInput ...
at Object.setPrompt ...
at JSON.stringify (<anonymous>)

So each onInput from the paste runs setPrompt → synchronous JSON.stringify of the prompt/editor state on the renderer main thread. With ~270 KB of pasted text this blocks the main thread long enough for the renderer to be flagged unresponsive and die. No minidump is produced (Crashpad dir empty) — consistent with a main-thread hang rather than a native crash. renderer.log shows only unrelated ResizeObserver noise.

Expected

Large pastes should not kill the app — e.g. debounce/coalesce input handling, move prompt serialization off the critical path (or off the main thread), and/or cap single-paste size with a graceful warning.

Attachments (will upload manually)

  • opencode-debug-20260929T021055.zip (exported debug bundle: main/window/renderer/crash logs)
  • The exact pasted content (~277 KB Docker pull log) that triggered it

opencode-debug-20260929T021055.zip

内容.txt

Activity

  1. github-actions commented on Sep 29, 2026

    @github-actions
    Contributor

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

    • #49238: Windows Desktop renderer hangs on a large paste in PromptInputV2, with similar paste/input-path stack traces.
    • #47425: Desktop freezes or crashes on Windows when pasting large text into the prompt.
    • #43935: Large JSON paste causes a renderer OOM in the prompt editor.
    • #46392: Large HTML paste freezes the Desktop renderer and leads to OOM.
  2. 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