Skip to content

TUI renders blank responses when launched from a symlinked directory #16528

@cristianmiranda

Description

@cristianmiranda

Description

When opencode is launched from a symlinked directory that contains a git repo (e.g. ~/dotfiles -> /real/path/dotfiles), the TUI shows blank responses. The model processes messages correctly (verified via opencode run and opencode export), but the TUI chat area remains empty.

The bug only occurs when the symlinked directory is a git repository. Symlinks to non-git directories work fine, since there's no git toplevel resolution to create a path mismatch.

Root cause: the TUI main thread resolves the directory from process.env.PWD (preserves the symlink path), while the worker uses process.cwd() (returns the physical/canonical path). Since Instance and Bus are keyed by directory string, this creates two separate instances. Events published by the main thread's instance never reach the worker's SSE subscription, so the TUI store never receives message updates.

  • thread.ts:114 — uses process.env.PWD/home/user/dotfiles
  • worker.ts:98 — uses process.cwd()/home/user/Documents/.../dotfiles

When both resolve to the same path (launching from the real path), everything works.

opencode_bug.mp4

Plugins

@mohak34/opencode-notifier, cursor-opencode-auth

OpenCode version

1.2.21

Steps to reproduce

  1. Create a symlinked directory pointing to a git repo: ln -s /real/path/myrepo ~/myrepo
  2. cd ~/myrepo
  3. Run opencode (TUI mode)
  4. Send any message (e.g. "hi")
  5. Observe blank response area — no text rendered
  6. Verify the model did respond: opencode export <session-id> shows the assistant message

Running from the real path (cd /real/path/myrepo && opencode) works correctly.

Note: Symlinks to directories without a git repo work fine — the bug requires a git repository to be present in the target directory.

Operating System

Arch Linux (x86_64)

Terminal

Alacritty

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