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
[BUG] Cyclic symlinks in global skills cause blank TUI and unbounded memory growth #42216
A cyclic directory symlink inside a global skill causes OpenCode to remain on a completely blank TUI while skill discovery recursively follows the loop.
On macOS, the process stayed alive, logs stopped at message=init, and memory grew to approximately 7.3 GB. Sampling showed a Bun worker repeatedly performing openat calls.
Moving the cyclic symlinks out of ~/.agents/skills fixed the issue immediately. With the same OpenCode binary and project, skill initialization then completed in about one second and the TUI rendered normally.
This appears to be a more severe form of #27027. That report covers large symlink targets and slow startup; this case uses an actual symlink cycle and results in effectively unbounded traversal and memory growth. #27072 has a similar blank-TUI symptom but concerns project file scanning rather than skill discovery.
Expected behavior
OpenCode should detect an already visited directory by real path or filesystem identity, skip the cyclic edge, emit a warning containing the offending path, and continue rendering the TUI.
Actual behavior
TUI remains completely blank
logs stop at message=init
the process continuously traverses files
memory usage keeps growing
no actionable error identifies the cyclic skill path
Diagnostic result
Following the affected skill tree reproduced recursive path expansion. After removing 16 nested symlinks that formed self and cross-directory cycles, the followed traversal contained only 177 entries and OpenCode logged init count=10 before rendering the full welcome screen.
Plugins
None
OpenCode version
1.18.16, installed with Homebrew
Steps to reproduce
Warning: this can cause rapid memory growth. Run only in a disposable HOME and stop the process promptly.
These reports describe the same underlying bug: skill discovery with followSymlinks: true and no cycle detection. Your report adds useful detail (memory growth to 7.3 GB, minimal reproduction script), so it may be worth linking rather than closing — but please check whether the existing issues already cover your case.
The cycle was introduced by the installed layout of two skills, find-skills and web-design-guidelines. Each of those skill directories contained symlinks to the top-level installed skills, including links back to itself and to the other skill.
So this was not merely a symlink to a large external tree: the way these installed skills referenced the shared top-level skill set created both direct self-loops and cross-skill loops. OpenCode followed those links during global skill discovery.
After moving only the 16 nested symlinks out of these two directories, while leaving both SKILL.md files intact, startup returned to normal.
Activity
github-actions commentedon Aug 13, 2026
This issue might be a duplicate of existing issues. Please check:
These reports describe the same underlying bug: skill discovery with
followSymlinks: trueand no cycle detection. Your report adds useful detail (memory growth to 7.3 GB, minimal reproduction script), so it may be worth linking rather than closing — but please check whether the existing issues already cover your case.YoungSens commentedon Aug 13, 2026
Additional detail about the real-world trigger:
The cycle was introduced by the installed layout of two skills,
find-skillsandweb-design-guidelines. Each of those skill directories contained symlinks to the top-level installed skills, including links back to itself and to the other skill.The relevant topology was equivalent to:
So this was not merely a symlink to a large external tree: the way these installed skills referenced the shared top-level skill set created both direct self-loops and cross-skill loops. OpenCode followed those links during global skill discovery.
After moving only the 16 nested symlinks out of these two directories, while leaving both
SKILL.mdfiles intact, startup returned to normal.thdxr commentedon Oct 11, 2026
Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (
opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊