Skip to content

fix(core): resolve symlinks to directories in file listing - #39308

Closed
notsobad wants to merge 2 commits into
anomalyco:devfrom
notsobad:symlink-dir-listing
Closed

fix(core): resolve symlinks to directories in file listing#39308
notsobad wants to merge 2 commits into
anomalyco:devfrom
notsobad:symlink-dir-listing

Conversation

@notsobad

@notsobad notsobad commented Jul 28, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #

Type of change

  • Bug fix

What does this PR do?

FileSystem.Service.list filtered out all symlink entries, so symlinks to directories were invisible in the directory picker and other file browsing contexts. readDirectoryEntries returns "symlink" type for symlinks, but the flatMap in list discarded anything that wasn't "file" or "directory".

The fix resolves symlinks via stat (which follows the link) and includes them with the resolved "file" or "directory" type. Broken symlinks are silently skipped via Effect.option. No schema or handler changes needed since the output type remains "file" | "directory".

How did you verified your code works?

I traced the code path: readDirectoryEntries classifies symlinks as "symlink", which then gets filtered out in list. The fix follows the same pattern as ReadToolFileSystem.list which already resolves symlinks via stat. The code compiles correctly with the added Option import.

Screenshots / recordings

N/A

Checklist

  • I have verified my changes locally
  • I have not included unrelated changes in this PR

FileSystem.Service.list filtered out all symlink entries, so symlinks to
directories were invisible in the directory picker and other file browsing
contexts. Resolve symlinks via stat (which follows the link) and include
them with the appropriate file or directory type.
@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label Jul 28, 2026
@github-actions

github-actions Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.
  • No issue referenced. Please add Closes #<number> linking to the relevant issue.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@github-actions

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Potential duplicate PRs found:

  1. #28532 - fix(filesystem): resolve symlink/junction targets to directory type in readDirectoryEntries

    • Directly addresses the same issue: resolving symlinks to their proper type in directory entries
  2. #29102 - fix(opencode): follow symlinks in file scan and directory listing

    • Related fix for following symlinks in file browsing contexts

These PRs appear to address the exact same problem: symlinks not being properly resolved and displayed in file listing/directory picker functionality. Check their status and implementation details to avoid duplicate work.

@notsobad notsobad closed this Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs:compliance This means the issue will auto-close after 2 hours. needs:issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant