Skip to content

desktop: ResizeObserver loop makes app unresponsive #52706

Closed

Description

@sbgraphic

Summary

The desktop app (Electron) becomes unresponsive due to an infinite ResizeObserver loop. The renderer floods with ResizeObserver loop completed with undelivered notifications errors, making the UI unusable. Restarting the app temporarily fixes it, but the issue returns.

Environment

  • opencode version: 2.0.21 (also occurs on 2.0.22)
  • OS: macOS Darwin 25.6.0 (arm64)
  • Terminal: Apple Terminal (xterm-256color)
  • Shell: /bin/zsh
  • Install/channel: latest (desktop app)
  • Active plugins: none

Reproduction

  1. Open the OpenCode desktop app
  2. Use the app normally (switch tabs, resize panels, work in editor)
  3. After some time, the UI becomes unresponsive
  4. Check logs — hundreds of ResizeObserver loop completed with undelivered notifications errors

Expected Behavior

The app should remain responsive without flooding the renderer with ResizeObserver errors.

Actual Behavior

The renderer process enters an infinite loop of ResizeObserver notifications, causing:

  • UI freeze / unresponsiveness
  • Hundreds of error logs per second
  • Need to restart the app to recover

Additional Context

Log excerpt (renderer.log):

[2026-10-02 09:59:10.580] [error] ResizeObserver loop completed with undelivered notifications.
[2026-10-02 09:59:27.346] [error] ResizeObserver loop completed with undelivered notifications.
[2026-10-02 09:59:49.663] [error] ResizeObserver loop completed with undelivered notifications.
... (hundreds more)

Workarounds tried:

  • Restarting the app — temporarily fixes until the loop restarts
  • Updating from 2.0.21 to 2.0.22 — did not resolve the issue

Frequency: Intermittent but frequent. Occurs multiple times per day during normal use.

Impact: Makes the app unusable for extended periods. Forces frequent restarts.

Activity

  1. github-actions commented on Oct 2, 2026

    @github-actions
    Contributor

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

  2. jeffjonessales-dev commented on Oct 14, 2026

    @jeffjonessales-dev

    Additional data point — same loop reproduced on Windows 11, desktop 2.0.29.

    Environment

    • opencode version: 2.0.29 (Electron desktop, OpenCode.exe + bundled opencode-cli.exe)
    • OS: Windows 11 Pro 10.0.26300.9711 (win32 x64)
    • Display: 1920x1080; window ~954x886 (not maximized)
    • Install/channel: latest (desktop, built-in updater reports 2.0.29 is current)
    • Active plugins: none

    Evidence

    Latest session, %APPDATA%\ai.opencode.desktop\logs\20261014T165524\renderer.log:

    • total log lines: 966
    • ResizeObserver loop completed with undelivered notifications.: 965
    • other [error] lines: 0
    • time span: 13:01:06 → 14:02:21 (~61 min) ⇒ ~15.8/min, continuous

    The renderer log is effectively nothing but this error.

    It is not specific to a virtual / network filesystem

    An earlier theory pointed at workspaces on a cloud/virtual FS (Google Drive, OneDrive). We reproduced it after moving the workspace to a local SSD (C:\Projects\...), so a virtual FS is not a necessary condition.

    It recurs across sessions and scales with session length / open time

    Short sessions show few or none; longer sessions show thousands:

    session ResizeObserver errors
    20261012T162448 5899
    20261013T190443 4408
    20261012T203614 2639
    20261014T161339 2301
    20261011T161500 968
    20261014T165524 965
    20261014T004710 52
    20261009T171641 0
    20261013T173530 1
    20261014T154824 1

    Workarounds tried

    • Full uninstall + reinstall of 2.0.29 — no change.
    • Restarting the app clears the flood temporarily, but it returns after several minutes of normal use (matches the reports above).

    Related open issue: #52927 (Intel macOS, idle app pins ~1 CPU core with software rendering + the same loop).

  3. SaifOmar commented on Oct 17, 2026

    @SaifOmar

    Additional data point — Linux / Wayland (Hyprland), desktop 2.0.29, Electron 44.7.2

    Same ResizeObserver loop. This report adds two things the current ones don't have: the resolved JS stack where the renderer spins, and direct proof that the renderer's main thread is the spinner.

    Environment

    • opencode desktop: 2.0.29 (AUR opencode-desktop-bin, Electron 44.7.2)
    • OS: Linux 7.2.5 (Arch/Omarchy), Wayland, Hyprland 0.56.2
    • GPU: hybrid Intel UHD 630 (display GPU) + NVIDIA Quadro P2000
    • Install/channel: latest; bundled opencode-cli 2.0.29
    • Active plugins: none

    Frequency

    Three of twelve launches froze today. ResizeObserver loop completed with undelivered notifications. appears in renderer.log even in runs that stayed responsive (e.g. 4 occurrences in one healthy run), so the loop runs on every launch — it only sometimes fails to converge.

    Proof the renderer main thread is the spinner

    renderer main thread: state=R (running)  %CPU=107  wchan=0
    all other threads:    state=S            wchan=do_epoll_wait / futex_do_wait
    

    CPU time climbed 52s → 55s in 3s of wall clock. A single-threaded JS spin, not a deadlock — which is why the app never recovers on its own.

    The spinning JS stack (from window.log, renderer unresponsive samples)

    at M.resizeItem            (route-*.js)
    at Map.forEach
    at w._scrollToOffset       (esm-*.js)
    at w.scrollToIndex
    at Proxy.scrollToEnd
    at ke                      (route-*.js)
    

    i.e. scrollToEnd → virtualizer _scrollToOffset → item resize → re-render → scrollToEnd. The loop lives in the virtualized message list and is triggered by auto-scroll-to-end on a long conversation, which lines up with the reported correlation with session length / open time.

    Not GPU-related

    --disable-gpu does not prevent the freeze (it only makes the app much slower). The loop is pure renderer JavaScript — no GL call in the stack — so GPU flags are worth ruling out for anyone reaching for them.

    Note for reproduction attempts

    On Linux the app appears to ignore --user-data-dir (it forces ~/.config/ai.opencode.desktop), so a fresh profile can't be used to isolate whether stored state triggers the loop.

  4. opencodejr commented on Oct 28, 2026

    @opencodejr

    Thanks for the detailed report, and thanks to everyone who added data points.

    I couldn't reproduce this here. It happens in the desktop (Electron) app after a long stretch of real use, and this sandbox can't run the desktop app or match a macOS or Windows setup. A maintainer with the desktop app will need to look at it.

    The renderer stack shared in the comments helps. It shows the app stuck in a cycle where scrolling the session timeline to the bottom triggers a resize, which scrolls it to the bottom again. That points at the timeline's scroll-to-bottom code.

    Related: #52927 shows the same loop on Intel macOS, with an idle app pinning about one CPU core.

  5. Hona commented on Oct 30, 2026

    @Hona
    Member

    Fixed in v2.2.1+ (#60034). Under fractional OS display scaling (125%/150%/175%) or desktop zoom, Chromium stops scrolling ~1-2px short of scrollHeight - clientHeight, which wedged the timeline virtualizer cold-mount settle microtask loop at 100% CPU. Please update to v2.2.1 or newer (v2.2.2 is current) and let us know if you still hit any unresponsiveness.

  6. f2569398058 commented on Oct 30, 2026

    @f2569398058

    Summary

    The right-side "审查" (Review) panel flickers and cannot be opened/held open on desktop v2.2.2 (which should already contain the fix from #60034). The renderer still floods with ResizeObserver loop completed with undelivered notifications. Windows, 175% display scaling — the exact fractional-scaling trigger identified in #60034.

    Environment

    • opencode version: 2.2.2 (desktop app, bundled CLI, and update feed all agree)
    • OS: Windows_NT 10.0.26300 (win32 x64)
    • Terminal: OpenCode desktop app (Electron), not the TUI
    • Shell: C:\WINDOWS\system32\cmd.exe
    • Install/channel: latest (desktop app)
    • Active plugins: none found in config (opencode.json has "plugin": [])
    • Display scaling: 175% (system DPI 168) — the fractional-scaling trigger from fix(app): treat the reachable end as the end under desktop zoom #60034

    Reproduction

    1. Launch OpenCode Desktop on Windows with 175% display scaling.
    2. Open a project/session.
    3. Click the right-side Review ("审查") panel.
    4. Observe the panel flicker open/closed; it never stays open.

    Expected Behavior

    The Review panel should open and remain open; the app should stay responsive.

    Actual Behavior

    The panel flickers and cannot be opened/held open. The renderer log floods:

    [2026-10-30 16:17:59.049] [error] ResizeObserver loop completed with undelivered notifications.
    [2026-10-30 16:17:59.161] [error] ResizeObserver loop completed with undelivered notifications.
    [2026-10-30 16:17:59.272] [error] ResizeObserver loop completed with undelivered notifications.
    [2026-10-30 16:17:59.373] [error] ResizeObserver loop completed with undelivered notifications.
    [2026-10-30 16:17:59.480] [error] ResizeObserver loop completed with undelivered notifications.
    

    169 occurrences in one session, with bursts of ~8 within 800 ms. main.log is clean (no crash); only the renderer is affected.

    Additional Context

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions