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
fix: resolve symlinks in Instance cache key to prevent duplicate instances #16648
Instance.provide() uses Filesystem.resolve() (which calls path.resolve()) to normalize the directory path before using it as a cache key. However, path.resolve() does not resolve symlinks — it only normalizes . / .. segments and makes the path absolute.
When opencode is launched from a symlinked directory (e.g., ~/src-office → ~/dtkr4-cnjjf), the TUI thread and worker can end up with different path representations of the same physical directory. This causes Instance.provide() to create two separate Instance contexts — one for each path string.
Because the Bus pub/sub system is Instance-scoped (via Instance.state()), events published on one Instance (where the LLM session runs) are never received by subscribers on the other Instance (where the SSE endpoint is listening). The result is a completely blank TUI — no messages, no parts, no output at all after sending a prompt.
Root Cause
// Instance.provide() — before fixconstdirectory=Filesystem.resolve(input.directory)// path.resolve() — does NOT resolve symlinksletexisting=cache.get(directory)// Different strings for same physical dir → cache miss → duplicate Instance
Fix
Add fs.realpathSync() before Filesystem.resolve() so symlinks are resolved to canonical paths:
Activity
github-actions commentedon Mar 8, 2026
This issue might be a duplicate of existing issues. Please check:
It may be worth coordinating with those issues to avoid duplicate effort or conflicting fixes.
fix: resolve symlinks in Instance cache to prevent duplicate contexts
jmylchreest commentedon Mar 8, 2026
Closing as duplicate — this is the same root cause as #15482 and #16647. Fix submitted in PR #16651.