Skip to content

Web UI crashes when browsing folders in the project picker #22655

Closed as not planned

Description

@JtMotoX

Description

When using the web UI to add a new project, the entire opencode process crashes if you try to browse to or search for a folder that's more than a couple levels deep. This happens whether you click through directories one at a time or paste a full absolute path into the search box.

For example, trying to open something like ~/projects/org/repo will kill the process before you ever get a chance to select it.

It looks like the directory picker walks through every intermediate directory in the path and boots a full server instance for each one (with file watchers, file scanning, LSP, snapshots, etc). Browsing to a path 4 levels deep ends up creating 4+ instances concurrently, which on Linux can exhaust inotify watch limits or memory and take down the process.

The directory picker really only needs to list folder names to let you browse around. It shouldn't need all of that heavy initialization just to do the equivalent of readdir.

Steps to reproduce

  1. Start opencode in web mode
  2. Open the "Open Project" dialog
  3. Type or paste a path that is 3 or more levels deep (e.g. ~/projects/org/repo)
  4. The opencode process crashes

Plugins

None

OpenCode version

v1.4.6

Screenshot and/or share link

No response

Operating System

AlmaLinux 9.7

Terminal

N/A (web UI)

Activity

  1. added
    core
    web
    on Apr 15, 2026
  2. JtMotoX commented on Apr 15, 2026

    @JtMotoX
    Author

    Update: downgrading to v1.4.3 resolves this. The crash started somewhere between v1.4.3 and v1.4.6.

  3. JtMotoX commented on Apr 16, 2026

    @JtMotoX
    Author

    Did some digging into what changed between v1.4.3 and v1.4.6 that could be causing this. There are two changes that together seem to be the culprit.

    Ripgrep switched from a native binary to embedded WASM (d684086, landed in v1.4.4)

    In v1.4.3, ripgrep ran as a native child process. Now it runs as WASM inside Bun Workers, meaning all the memory from concurrent scans lives inside the main process. When the directory picker boots multiple instances at once (one per path segment), all those ripgrep scans share the same memory space instead of being isolated OS processes. Much easier to OOM.

    Bootstrap was parallelized (94f71f5 + 548d9ac, landed in v1.4.4/v1.4.5)

    In v1.4.3, instance bootstrap was sequential. Plugin init, then LSP, then File, then FileWatcher, etc. Now all 8 services (including ripgrep file scanning, file watchers, LSP, snapshots) are fork-detached in parallel via Effect.all. So each browsed directory fires off everything at once, and when the picker is walking through multiple directories, you end up with a huge number of concurrent operations all fighting for resources.

    Put those two together and browsing 3+ levels deep means 3+ instances booting simultaneously, each launching 8 parallel services including in-process WASM ripgrep scans. On Linux this can blow past inotify limits or exhaust memory and kill the process.

  4. removed
    web
    core
    on May 3, 2026
  5. evatths commented on Jun 3, 2026

    @evatths

    This is still a problem, right? I can't open projects more than 2 layers deep.

  6. StephanDollberg commented on Jul 10, 2026

    @StephanDollberg

    Yes it is.

  7. github-actions commented on Sep 9, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

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