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
{{ message }}
Repository navigation
TUI renders blank responses when launched from a symlinked directory #16528
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.
FWIW, I'm experiencing what appears to be the same issue, BUT... in my case, the presence of absence of a Git repo makes no difference in the OpenCode behavior. I simply see the case where:
If I launch OpenCode from a symlinked directory, responses are not rendered in the session (but if you exit out and then resume the session, it appears that those responses are in the session history)
If I launch OpenCode in the same directory, but using the real path, it works fine.
This is all on PopOS 22.04 LTS and using OpenCode 1.2.21.
Reacted by Cristian Miranda, Santiago M. Mola and cfchou
FWIW, I'm experiencing what appears to be the same issue, BUT... in my case, the presence of absence of a Git repo makes no difference in the OpenCode behavior. I simply see the case where:
If I launch OpenCode from a symlinked directory, responses are not rendered in the session (but if you exit out and then resume the session, it appears that those responses are in the session history)
If I launch OpenCode in the same directory, but using the real path, it works fine.
This is all on PopOS 22.04 LTS and using OpenCode 1.2.21.
Looks like this fix would cover that exact scenario 🙌🏽
I am also facing the same issue. In this case, I am on Aurora Linux, which symlinks the entire home directory, so opencode doesn't work anywhere.
Here is some more info:
Bug Description
On Fedora Atomic desktops (Silverblue, Aurora, Bazzite, etc.), /home is a symlink to /var/home. Starting in v1.2.21, the TUI renders blank assistant responses — the agent header appears but no response text is shown. The backend works correctly (LLM responses are received and stored in the database).
Root Cause
The v1.2.21 changes to thread.ts and server.ts introduced Filesystem.resolve() for directory path handling. On Linux, Filesystem.resolve() calls path.resolve(), which does not follow symlinks. This creates a path mismatch:
process.env.PWD = /home/joey (the symlink path, set by the shell)
process.cwd() = /var/home/joey (the real path, because the kernel resolves symlinks on chdir)
This /home/joey path is passed as directory to the SDK client, which sends it as the x-opencode-directory header. But elsewhere in the server pipeline, process.cwd() returns /var/home/joey, causing a mismatch between the TUI's directory context and the server's instance directory. Events are published under one path but the TUI is listening under the other.
Reproduction
Use any Linux distro where /home is a symlink (e.g., Fedora Atomic: /home → var/home)
Run opencode v1.2.21
Send any message
The agent header appears but the response text is blank
The response IS stored in the sqlite database — only the TUI rendering fails
Workarounds
Set PWD to the real path: PWD=/var/home/joey opencode works
Add export PWD=$(realpath "$PWD") to shell rc
Downgrade to v1.2.20
Suggested Fix
Filesystem.resolve() on Linux should follow symlinks (e.g., use fs.realpathSync) rather than just path.resolve(), which only normalizes path segments without resolving symlinks. Alternatively, thread.ts could use process.cwd() instead of process.env.PWD since process.cwd() always returns the canonical path.
Version Info
Works: v1.2.20
Broken: v1.2.21
Platform: Fedora Aurora 43 (Fedora Atomic), Linux 6.18.7
I am also facing the same issue. In this case, I am on Aurora Linux, which symlinks the entire home directory, so opencode doesn't work anywhere.
Here is some more info:
Bug Description
On Fedora Atomic desktops (Silverblue, Aurora, Bazzite, etc.), /home is a symlink to /var/home. Starting in v1.2.21, the TUI renders blank assistant responses — the agent header appears but no response text is shown. The backend works correctly (LLM responses are received and stored in the database).
Root Cause
The v1.2.21 changes to thread.ts and server.ts introduced Filesystem.resolve() for directory path handling. On Linux, Filesystem.resolve() calls path.resolve(), which does not follow symlinks. This creates a path mismatch:
process.env.PWD = /home/joey (the symlink path, set by the shell)
process.cwd() = /var/home/joey (the real path, because the kernel resolves symlinks on chdir)
This /home/joey path is passed as directory to the SDK client, which sends it as the x-opencode-directory header. But elsewhere in the server pipeline, process.cwd() returns /var/home/joey, causing a mismatch between the TUI's directory context and the server's instance directory. Events are published under one path but the TUI is listening under the other.
Reproduction
Use any Linux distro where /home is a symlink (e.g., Fedora Atomic: /home → var/home)
Run opencode v1.2.21
Send any message
The agent header appears but the response text is blank
The response IS stored in the sqlite database — only the TUI rendering fails
Workarounds
Set PWD to the real path: PWD=/var/home/joey opencode works
Add export PWD=$(realpath "$PWD") to shell rc
Downgrade to v1.2.20
Suggested Fix
Filesystem.resolve() on Linux should follow symlinks (e.g., use fs.realpathSync) rather than just path.resolve(), which only normalizes path segments without resolving symlinks. Alternatively, thread.ts could use process.cwd() instead of process.env.PWD since process.cwd() always returns the canonical path.
Version Info
Works: v1.2.20
Broken: v1.2.21
Platform: Fedora Aurora 43 (Fedora Atomic), Linux 6.18.7
Activity
github-actions commentedon Mar 7, 2026
This issue might be a duplicate of existing issues. Please check:
thread.tsand even a proposed fixPlease review those issues and consider closing this one if they cover your case, or add any additional context that differs.
fix: resolve TUI blank response when launched from symlinked directory
mindcrime commentedon Mar 8, 2026
FWIW, I'm experiencing what appears to be the same issue, BUT... in my case, the presence of absence of a Git repo makes no difference in the OpenCode behavior. I simply see the case where:
This is all on PopOS 22.04 LTS and using OpenCode 1.2.21.
cristianmiranda commentedon Mar 8, 2026
Looks like this fix would cover that exact scenario 🙌🏽
prolific commentedon Mar 8, 2026
Yes, I am also facing exactly the same issue where not seeing any responses in TUI when opened inside symlinked directory.
jyapayne commentedon Mar 8, 2026
I am also facing the same issue. In this case, I am on Aurora Linux, which symlinks the entire home directory, so opencode doesn't work anywhere.
Here is some more info:
Bug Description
On Fedora Atomic desktops (Silverblue, Aurora, Bazzite, etc.),
/homeis a symlink to/var/home. Starting in v1.2.21, the TUI renders blank assistant responses — the agent header appears but no response text is shown. The backend works correctly (LLM responses are received and stored in the database).Root Cause
The v1.2.21 changes to
thread.tsandserver.tsintroducedFilesystem.resolve()for directory path handling. On Linux,Filesystem.resolve()callspath.resolve(), which does not follow symlinks. This creates a path mismatch:process.env.PWD=/home/joey(the symlink path, set by the shell)process.cwd()=/var/home/joey(the real path, because the kernel resolves symlinks onchdir)In
thread.ts(line 114):This
/home/joeypath is passed asdirectoryto the SDK client, which sends it as thex-opencode-directoryheader. But elsewhere in the server pipeline,process.cwd()returns/var/home/joey, causing a mismatch between the TUI's directory context and the server's instance directory. Events are published under one path but the TUI is listening under the other.Reproduction
/homeis a symlink (e.g., Fedora Atomic:/home→var/home)opencodev1.2.21Workarounds
PWDto the real path:PWD=/var/home/joey opencodeworksexport PWD=$(realpath "$PWD")to shell rcSuggested Fix
Filesystem.resolve()on Linux should follow symlinks (e.g., usefs.realpathSync) rather than justpath.resolve(), which only normalizes path segments without resolving symlinks. Alternatively,thread.tscould useprocess.cwd()instead ofprocess.env.PWDsinceprocess.cwd()always returns the canonical path.Version Info
Bisection
The regression was introduced in the v1.2.20→v1.2.21 release. The relevant commits that changed path handling:
server.ts: AddedFilesystem.resolve()wrapper around directory in middlewarethread.ts: Changedprocess.env.PWD ?? process.cwd()toFilesystem.resolve(process.env.PWD ?? process.cwd())instance.ts: AddedFilesystem.resolve(input.directory)inInstance.provide()cristianmiranda commentedon Mar 8, 2026
You can try out the fix in my PR and see how that goes.