OpenCode does not show UI in terminal or web #7912

Closed
opened 2026-02-16 18:08:39 -05:00 by yindo · 3 comments
Owner

Originally created by @jara505 on GitHub (Jan 28, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

Problem Description
When starting OpenCode on Linux, the interface does not appear in the terminal and in the browser it loads indefinitely. The process never reaches the point of displaying the UI.

What I have tried so far

  • Running opencode and opencode web
  • Switching Node versions (20 and 24)
  • Installing older versions of OpenCode (including 0.8.x), but none worked
  • Using environment variables:
    • OPENCODE_DISABLE_PLUGINS=1
    • OPENCODE_DISABLE_DEFAULT_PLUGINS=true
  • Clearing configuration and cache (~/.config/opencode, ~/.cache/opencode)
  • Running opencode uninstall and reinstalling

None of this has solved the issue; even after opencode uninstall, the UI still does not appear.

Relevant logs

INFO  2026-01-29T04:21:32 +694ms service=server method=GET path=/ request
INFO  2026-01-29T04:21:32 +0ms service=server status=started method=GET path=/ request
INFO  2026-01-29T04:21:32 +4ms service=default directory=/home/prueba creating instance
INFO  2026-01-29T04:21:32 +3ms service=project directory=/home/prueba fromDirectory
INFO  2026-01-29T04:21:32 +8ms service=storage index=0 running migration
INFO  2026-01-29T04:21:32 +5ms service=storage index=1 running migration
INFO  2026-01-29T04:21:32 +17ms service=default directory=/home/prueba bootstrapping
INFO  2026-01-29T04:21:32 +21ms service=bun cmd=["/home/prueba/.config/nvm/versions/node/v20.20.0/lib/node_modules/opencode-ai/node_modules/opencode-linux-x64/bin/opencode","add","@opencode-ai/plugin@1.1.41","--exact"] cwd=/home/prueba/.config/opencode running


Plugins

No response

OpenCode version

1.1.41

Steps to reproduce

No response

Screenshot and/or share link

Image

Operating System

EndeavourOS (Arch Linux-based)

Terminal

Alacritty

Originally created by @jara505 on GitHub (Jan 28, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description **Problem Description** When starting OpenCode on Linux, the interface **does not appear in the terminal** and in the browser it **loads indefinitely**. The process never reaches the point of displaying the UI. **What I have tried so far** - Running `opencode` and `opencode web` - Switching Node versions (20 and 24) - Installing older versions of OpenCode (including 0.8.x), but none worked - Using environment variables: - `OPENCODE_DISABLE_PLUGINS=1` - `OPENCODE_DISABLE_DEFAULT_PLUGINS=true` - Clearing configuration and cache (`~/.config/opencode`, `~/.cache/opencode`) - Running `opencode uninstall` and reinstalling None of this has solved the issue; even after `opencode uninstall`, the UI still does not appear. **Relevant logs** ``` INFO 2026-01-29T04:21:32 +694ms service=server method=GET path=/ request INFO 2026-01-29T04:21:32 +0ms service=server status=started method=GET path=/ request INFO 2026-01-29T04:21:32 +4ms service=default directory=/home/prueba creating instance INFO 2026-01-29T04:21:32 +3ms service=project directory=/home/prueba fromDirectory INFO 2026-01-29T04:21:32 +8ms service=storage index=0 running migration INFO 2026-01-29T04:21:32 +5ms service=storage index=1 running migration INFO 2026-01-29T04:21:32 +17ms service=default directory=/home/prueba bootstrapping INFO 2026-01-29T04:21:32 +21ms service=bun cmd=["/home/prueba/.config/nvm/versions/node/v20.20.0/lib/node_modules/opencode-ai/node_modules/opencode-linux-x64/bin/opencode","add","@opencode-ai/plugin@1.1.41","--exact"] cwd=/home/prueba/.config/opencode running ``` ### Plugins _No response_ ### OpenCode version 1.1.41 ### Steps to reproduce _No response_ ### Screenshot and/or share link <img width="888" height="603" alt="Image" src="https://github.com/user-attachments/assets/69be2edb-961b-4beb-8f37-763d163e7d6b" /> ### Operating System EndeavourOS (Arch Linux-based) ### Terminal Alacritty
yindo added the opentuibug labels 2026-02-16 18:08:39 -05:00
yindo closed this issue 2026-02-16 18:08:39 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 28, 2026):

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

  • #6557: Web UI does not load when running opencode web - Similar symptom of browser showing black/blank screen indefinitely with module loading errors
  • #9577: White screen on launch – OpenCode Desktop (Windows 10) - Similar UI rendering issue where the interface never appears
  • #8383: opencode stuck to run - Similar symptom of OpenCode freezing during startup/initialization
  • #9963: Can't run OpenCode under WSL2 Ubuntu, returns empty screen - Similar Linux/Ubuntu-specific issue with blank screen on startup

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Jan 28, 2026): This issue might be a duplicate of existing issues. Please check: - #6557: Web UI does not load when running `opencode web` - Similar symptom of browser showing black/blank screen indefinitely with module loading errors - #9577: White screen on launch – OpenCode Desktop (Windows 10) - Similar UI rendering issue where the interface never appears - #8383: opencode stuck to run - Similar symptom of OpenCode freezing during startup/initialization - #9963: Can't run OpenCode under WSL2 Ubuntu, returns empty screen - Similar Linux/Ubuntu-specific issue with blank screen on startup Feel free to ignore if none of these address your specific case.
Author
Owner

@nickwood commented on GitHub (Jan 29, 2026):

I've also been having a similar issues. I'm unable to spawn opencode in a directory with a .git subdirectory. Workaround was to run with the env_var OPENCODE_EXPERIMENTAL_DISABLE_FILEWATCHER=true

Full bug report (written with the help of opencode):

Summary
OpenCode 1.1.41 hangs indefinitely with a black screen when started in any directory containing a .git directory on Ubuntu 24.04 with kernel 6.14. The issue is caused by the Parcel file watcher's inotify subscription. Setting OPENCODE_EXPERIMENTAL_DISABLE_FILEWATCHER=true resolves the issue.
Environment

  • OpenCode version: 1.1.41
  • OS: Ubuntu 24.04.3 LTS (Noble Numbat)
  • Kernel: 6.14.0-1019-oem
  • Architecture: x86_64
  • Shell: zsh (with bash as system default)
  • libgit2: 1.7.2
  • Terminal: Tested in both Terminator and Konsole - same behavior
    Steps to Reproduce
  1. Install OpenCode 1.1.41 on Ubuntu 24.04 with kernel 6.14
  2. Navigate to any git repository, or create a fresh one:
    cd /tmp
    mkdir test-repo
    cd test-repo
    git init
    3. Run opencode
  3. Observe: Terminal goes completely black, no UI renders, process consumes CPU
    Expected Behavior
    OpenCode should start and display the TUI interface.
    Actual Behavior
  • Terminal goes completely black (no UI frame, no content)
  • Process enters a busy-wait loop (strace shows constant futex wake/wait + sched_yield)
  • opencode web also hangs
  • opencode run "message" also hangs
  • opencode debug config and opencode debug paths work correctly in git directories
    Workaround
    Setting the experimental flag resolves the issue:
    export OPENCODE_EXPERIMENTAL_DISABLE_FILEWATCHER=true
    opencode
    Diagnostic Details
    What works:
  • OpenCode in non-git directories (~/.config, /tmp)
  • opencode debug config in git directories
  • opencode debug paths in git directories
  • Git operations themselves (git status, git fetch, etc.)
    What fails:
  • opencode (TUI) in any git directory
  • opencode web in any git directory
  • opencode run in any git directory
  • Even a fresh git init repo with no remote triggers the issue
    Log analysis:
    When running with --print-logs, output stops early at config loading phase. However, log files written to ~/.local/share/opencode/log/ show the backend initializes successfully up to VCS detection:
    INFO service=vcs branch=main initialized
    INFO service=file.watcher platform=linux backend=inotify watcher backend
    strace analysis:
    Running with strace shows the process enters a busy futex loop:
    futex(0x7817ab0d0164, FUTEX_WAKE_PRIVATE, 1) = 1
    futex(0x7817ab098164, FUTEX_WAKE_PRIVATE, 1) = 1
    sched_yield() = 0
    futex(0x7817ab0e8164, FUTEX_WAKE_PRIVATE, 1) = 1
    ... (repeats indefinitely)
    This pattern indicates a spinlock or livelock condition.
    Ruled out:
  • Git configuration (tested with empty ~/.gitconfig)
  • SSH configuration (git operations work fine)
  • Remote repositories (fresh git init with no remote fails)
  • OpenCode cache (cleared ~/.cache/opencode)
  • OpenCode config (tested with no opencode.jsonc)
  • inotify limits (65536 max_user_watches, only ~6000 in use)
  • Terminal emulator (same behavior in Terminator and Konsole)
    Suspected Root Cause
    Based on code review, the issue appears to be in packages/opencode/src/file/watcher.ts. When OpenCode detects a git repository, it:
  1. Initializes a Parcel watcher (@parcel/watcher) for the project directory
  2. Additionally subscribes to watch the .git directory to detect branch changes
    The inotify subscription (used on Linux) appears to cause a busy-wait condition on this kernel/system configuration. The watcher initialization only occurs when Instance.project.vcs === "git", which explains why non-git directories work fine.
    Additional Context
  • Other team members on the same OpenCode version do not experience this issue (different kernel versions suspected)
  • The OEM kernel 6.14.0-1019-oem may have different inotify behavior than standard kernels
@nickwood commented on GitHub (Jan 29, 2026): I've also been having a similar issues. I'm unable to spawn opencode in a directory with a .git subdirectory. Workaround was to run with the env_var `OPENCODE_EXPERIMENTAL_DISABLE_FILEWATCHER=true` Full bug report (written with the help of opencode): Summary OpenCode 1.1.41 hangs indefinitely with a black screen when started in any directory containing a .git directory on Ubuntu 24.04 with kernel 6.14. The issue is caused by the Parcel file watcher's inotify subscription. Setting OPENCODE_EXPERIMENTAL_DISABLE_FILEWATCHER=true resolves the issue. Environment - OpenCode version: 1.1.41 - OS: Ubuntu 24.04.3 LTS (Noble Numbat) - Kernel: 6.14.0-1019-oem - Architecture: x86_64 - Shell: zsh (with bash as system default) - libgit2: 1.7.2 - Terminal: Tested in both Terminator and Konsole - same behavior Steps to Reproduce 1. Install OpenCode 1.1.41 on Ubuntu 24.04 with kernel 6.14 2. Navigate to any git repository, or create a fresh one: cd /tmp mkdir test-repo cd test-repo git init 3. Run opencode 4. Observe: Terminal goes completely black, no UI renders, process consumes CPU Expected Behavior OpenCode should start and display the TUI interface. Actual Behavior - Terminal goes completely black (no UI frame, no content) - Process enters a busy-wait loop (strace shows constant futex wake/wait + sched_yield) - opencode web also hangs - opencode run "message" also hangs - opencode debug config and opencode debug paths work correctly in git directories Workaround Setting the experimental flag resolves the issue: export OPENCODE_EXPERIMENTAL_DISABLE_FILEWATCHER=true opencode Diagnostic Details What works: - OpenCode in non-git directories (~/.config, /tmp) - opencode debug config in git directories - opencode debug paths in git directories - Git operations themselves (git status, git fetch, etc.) What fails: - opencode (TUI) in any git directory - opencode web in any git directory - opencode run in any git directory - Even a fresh git init repo with no remote triggers the issue Log analysis: When running with --print-logs, output stops early at config loading phase. However, log files written to ~/.local/share/opencode/log/ show the backend initializes successfully up to VCS detection: INFO service=vcs branch=main initialized INFO service=file.watcher platform=linux backend=inotify watcher backend strace analysis: Running with strace shows the process enters a busy futex loop: futex(0x7817ab0d0164, FUTEX_WAKE_PRIVATE, 1) = 1 futex(0x7817ab098164, FUTEX_WAKE_PRIVATE, 1) = 1 sched_yield() = 0 futex(0x7817ab0e8164, FUTEX_WAKE_PRIVATE, 1) = 1 ... (repeats indefinitely) This pattern indicates a spinlock or livelock condition. Ruled out: - Git configuration (tested with empty ~/.gitconfig) - SSH configuration (git operations work fine) - Remote repositories (fresh git init with no remote fails) - OpenCode cache (cleared ~/.cache/opencode) - OpenCode config (tested with no opencode.jsonc) - inotify limits (65536 max_user_watches, only ~6000 in use) - Terminal emulator (same behavior in Terminator and Konsole) Suspected Root Cause Based on code review, the issue appears to be in packages/opencode/src/file/watcher.ts. When OpenCode detects a git repository, it: 1. Initializes a Parcel watcher (@parcel/watcher) for the project directory 2. Additionally subscribes to watch the .git directory to detect branch changes The inotify subscription (used on Linux) appears to cause a busy-wait condition on this kernel/system configuration. The watcher initialization only occurs when Instance.project.vcs === "git", which explains why non-git directories work fine. Additional Context - Other team members on the same OpenCode version do not experience this issue (different kernel versions suspected) - The OEM kernel 6.14.0-1019-oem may have different inotify behavior than standard kernels
Author
Owner

@jara505 commented on GitHub (Jan 29, 2026):

If you are experiencing a "Black Screen" hang ,the issue is a network deadlock caused by IPv6.

The application (via the Bun/Node engine) gets stuck indefinitely trying to establish a connection over IPv6 that never receives a response. Disabling IPv6 forces the app to use IPv4, which resolves the initialization hang and allows the AI models to respond correctly.

@jara505 commented on GitHub (Jan 29, 2026): If you are experiencing a "Black Screen" hang ,the issue is a network deadlock caused by IPv6. The application (via the Bun/Node engine) gets stuck indefinitely trying to establish a connection over IPv6 that never receives a response. Disabling IPv6 forces the app to use IPv4, which resolves the initialization hang and allows the AI models to respond correctly.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#7912