-
Notifications
You must be signed in to change notification settings - Fork 14k
Description
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— usesprocess.env.PWD→/home/user/dotfilesworker.ts:98— usesprocess.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
- Create a symlinked directory pointing to a git repo:
ln -s /real/path/myrepo ~/myrepo cd ~/myrepo- Run
opencode(TUI mode) - Send any message (e.g. "hi")
- Observe blank response area — no text rendered
- 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