You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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 viaopencode runandopencode 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 usesprocess.cwd()(returns the physical/canonical path). SinceInstanceandBusare 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/.../dotfilesWhen 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
ln -s /real/path/myrepo ~/myrepocd ~/myrepoopencode(TUI mode)opencode export <session-id>shows the assistant messageRunning 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