[PR #10366] fix(opencode): resolve symlinks to directories in project picker #13416

Open
opened 2026-02-16 18:18:16 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/10366

State: open
Merged: No


Fixes #10365

Summary

Symlinked directories weren't visible in the project picker because entry.isDirectory() returns false for symlinks.

Changes

Added symlink detection with parallel target resolution:

const isDir = entry.isDirectory() || (entry.isSymbolicLink() && await Filesystem.isDir(fullPath))
  • Uses existing Filesystem.isDir() (Bun API)
  • stat() only for symlinks (short-circuit)
  • Parallel processing via Promise.all()

Files

File Change
packages/opencode/src/file/index.ts Symlink handling in File.list() and home scan
packages/opencode/test/file/symlink.test.ts 5 tests (new)
packages/opencode/test/util/filesystem.test.ts 1 test

Verification

ln -s /tmp/real-dir ~/Projects/symlink-dir
bun dev  # symlink-dir visible in picker
bun test test/file/symlink.test.ts  # 5 pass
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/10366 **State:** open **Merged:** No --- Fixes #10365 ## Summary Symlinked directories weren't visible in the project picker because `entry.isDirectory()` returns `false` for symlinks. ## Changes Added symlink detection with parallel target resolution: ```ts const isDir = entry.isDirectory() || (entry.isSymbolicLink() && await Filesystem.isDir(fullPath)) ``` - Uses existing `Filesystem.isDir()` (Bun API) - `stat()` only for symlinks (short-circuit) - Parallel processing via `Promise.all()` ## Files | File | Change | |------|--------| | `packages/opencode/src/file/index.ts` | Symlink handling in `File.list()` and home scan | | `packages/opencode/test/file/symlink.test.ts` | 5 tests (new) | | `packages/opencode/test/util/filesystem.test.ts` | 1 test | ## Verification ```bash ln -s /tmp/real-dir ~/Projects/symlink-dir bun dev # symlink-dir visible in picker bun test test/file/symlink.test.ts # 5 pass
yindo added the pull-request label 2026-02-16 18:18:16 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#13416