Skip to content

tui: crashes with ENOSPC when inotify watch limit is exhausted #51208

Closed

Description

@arh

Description

The TUI crashes on startup with ENOSPC: no space left on device, watch '.../state/opencode/next/tui' when the host's fs.inotify.max_user_watches limit is exhausted (this is not an actual disk-space issue). packages/tui/src/context/storage.tsx calls raw fs.watch() with no try/catch. fs.watch throws synchronously when inotify_add_watch fails, so the exception propagates straight through Solid's render and kills the whole app instead of just disabling live-reload.

Reproducible on demand on a host with enough long-running processes holding inotify watches (editors, LSPs, other opencode instances watching a big repo). Elsewhere in the codebase (core/src/config/plugin/skill.ts's ConfigSkillPlugin.watch), the same failure is caught and logged instead of crashing.

I have a fix ready (wraps the watch() call in try/catch, logs and disables live-reload instead of crashing) and will open a PR referencing this issue.

OpenCode version

0.0.0-next-17444 (also reproduced against v2.0.16 / current v2 tip - same code path)

Steps to reproduce

  1. On a host, exhaust fs.inotify.max_user_watches (e.g. run several long-lived file watchers, or enough editors/LSPs/opencode instances against a big repo).
  2. Start a new opencode TUI session.
  3. TUI crashes immediately with ENOSPC: no space left on device, watch '.../state/opencode/next/tui'.

Operating System

Linux 6.12.94 (x64)

Terminal

tmux 3.3a

Activity

  1. Tarquinen commented on Oct 20, 2026

    @Tarquinen
    Member

    This was fixed by #51210 and #51243. Those PRs merged into the v2 branch, so GitHub didn't close this issue automatically. Closing as completed.

    — from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions