refactor(file): use AppFileSystem instead of raw Filesystem#19458
Merged
kitlangton merged 3 commits intodevfrom Mar 28, 2026
Merged
refactor(file): use AppFileSystem instead of raw Filesystem#19458kitlangton merged 3 commits intodevfrom
kitlangton merged 3 commits intodevfrom
Conversation
Replace Filesystem.exists/readText/readBytes with AppFileSystem.Service in the File service read and list methods. Adds defaultLayer providing AppFileSystem.defaultLayer.
…/isFile types
- readDirectoryEntries: returns DirEntry[] with name+type using
readdir({ withFileTypes: true }) — preserves symlink/Dirent semantics
- existsSafe: returns Effect<boolean> with no error channel
- isDir/isFile: narrowed to Effect<boolean> (errors already swallowed)
- File.list: uses readDirectoryEntries instead of stat() per entry,
fixing symlink-follows-through and broken-symlink-disappears regressions
- File.read: uses existsSafe instead of exists+catch
Copilot AI
pushed a commit
to ian-morgan99/opencode
that referenced
this pull request
Mar 28, 2026
…o#19458) Co-authored-by: ian-morgan99 <106852423+ian-morgan99@users.noreply.github.com>
e-n-0
pushed a commit
to e-n-0/opencode
that referenced
this pull request
Mar 29, 2026
loocor
pushed a commit
to loocor/opencode
that referenced
this pull request
Mar 30, 2026
afanty2021
pushed a commit
to afanty2021/opencode
that referenced
this pull request
Mar 30, 2026
balcsida
pushed a commit
to balcsida/opencode
that referenced
this pull request
Apr 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AppFileSystem.Servicein its layerreadmethod: replacedFilesystem.exists/readText/readByteswithappFs.exists/readFileString/readFilelistmethod: replacedFilesystem.exists/readTextwithappFs.readFileString/readDirectoryFile.defaultLayerprovidingAppFileSystem.defaultLayerscanandstatusmethods kept as-is (needfs.Dirent/ complex git pipelines)Stacked on #19457
Test plan
bun run typecheckpassesbun test test/file/— 91 pass, 0 fail