-
Notifications
You must be signed in to change notification settings - Fork 12.3k
Description
Description
Commit 8a95be4 introduced Filesystem.resolve() which calls realpathSync.native() to canonicalize the project directory. This dereferences symlinks. The resolve call was added to the server request middleware (server.ts), the instance cache (instance.ts), and the TUI entry point (thread.ts). The app frontend (directory-layout.tsx) was also updated to call /path, detect the resolved directory, and redirect the URL slug to match.
When OpenCode is launched from a directory that is (or is inside) a symlink, the client initially sends the symlink path but the server resolves it to the real target path. This creates a mismatch: the instance is keyed by the real path, but the frontend may still reference the symlink path in some flows. The result is that sessions are broken and AI output is not visible. Launching from the real (non-symlink) path works fine.
Plugins
None
OpenCode version
Unknown; regression introduced by 8a95be4
Steps to reproduce
- Create a symlink to a repo:
ln -s /path/to/real/repo /path/to/link/repo cd /path/to/link/repo(confirmpwdshows the symlink path).- Start OpenCode (TUI or app).
- Create/open a session and send a prompt.
- Observe: session UI appears broken and AI output is not visible.
- Repeat from the real path (
cd /path/to/real/repo) and note it works normally.
Screenshot and/or share link
N/A
Operating System
macOS 26.3.1 (Build 25D2128)
Terminal
Ghostty 1.2.3 (stable)