Skip to content

Symlinked directories not visible in project picker (opencode serve) #10365

Closed

Description

@frizikk

Description

Description

Symlinked directories are not visible in the project picker when running opencode serve.

Steps to Reproduce

  1. Create a symlink to a directory:
    ln -s /mnt/data/Projects ~/Projects
  2. Run opencode serve
  3. Open web UI and use project picker
  4. Navigate to ~/Projects
    Expected: Symlinked subdirectories appear as directories
    Actual: They are hidden or shown as files

Root Cause

fs.readdir() with withFileTypes: true returns entry.isDirectory() = false for symlinks, even when pointing to directories.
Affected code in packages/opencode/src/file/index.ts:

  • File.list() - directory listing API
  • Home directory scanning

Environment

  • OS: Linux
  • OpenCode: latest

Plugins

No response

OpenCode version

1.1.34

Steps to reproduce

  1. Create a symlink to a projects directory:
    ln -s /mnt/data/Projects ~/Projects
  2. Start the server:
    opencode serve
    3. Open web UI in browser
  3. Open project picker dialog
  4. Navigate to ~/Projects

Screenshot and/or share link

No response

Operating System

CachyOS Linux (arch btw)

Terminal

Ghostty

Activity

  1. github-actions commented on Jan 24, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    Feel free to ignore if none of these address your specific case.

  2. jeroenev commented on Feb 6, 2026

    @jeroenev

    They are also not visible in ripgrep (search tool) and cannot be @tagged in opencode

  3. panta82 commented on Feb 7, 2026

    @panta82
    Contributor

    Just got hit by this. My clanker analyzed and wrote this:

    This is a regression introduced in commit c0e71c4 (PR #11415 — "fix: don't --follow by default for grep and other things using ripgrep").

    The change in packages/opencode/src/file/ripgrep.ts flipped the default for --follow from opt-out to opt-in:

    • if (input.follow !== false) args.push("--follow")
    • if (input.follow) args.push("--follow")

    This was applied to both Ripgrep.files() and Ripgrep.search(). The intent was to stop grep from following symlinks by default, but it also broke the file indexer which never passes follow explicitly.

    The file indexer at packages/opencode/src/file/index.ts:170 calls:
    for await (const file of Ripgrep.files({ cwd: Instance.directory })) {

    Since follow is undefined, the old code treated it as undefined !== false → true → --follow added. The new code treats it as falsy → --follow omitted.

    Impact: Symlinked directories in a project are no longer traversed by the @ file picker or ripgrep search in the TUI. This affects workspace setups that use symlinks to aggregate multiple project directories.

    Fix: The file indexer call should explicitly pass follow: true:
    for await (const file of Ripgrep.files({ cwd: Instance.directory, follow: true })) {

  4. github-actions commented on Apr 9, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

  5. added a commit that references this issue on May 20, 2026
    7b29ce7
  6. added a commit that references this issue on Jun 4, 2026
    eccb75a
  7. added a commit that references this issue on Jun 5, 2026
    8559f60
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingwebRelates to opencode on web / desktop

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions