anomalyco / anomalyco/opencode
FSUtil.resolve aborts the calling fiber on non-NotFound realPath failure
@jlongster is already working on this.
Since Aug 26, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Summary
FSUtil.resolve() only tolerated a NotFound failure from realPath; every other failure (for example PermissionDenied on an unreadable traversal component such as C:\System Volume Information on Windows, or ELOOP) escaped as a defect via Effect.orDie and killed the calling fiber.
The worst caller is the bash tool's external-command scan: it resolves every absolute-looking command argument before showing the permission prompt and documents those warnings as "advisory only". A single unreadable path in a command string (e.g. referencing a protected directory) aborted the entire tool with an opaque defect instead of degrading to the lexical path.
Expected
resolve() should best-effort canonicalize and, when canonicalization is impossible for any reason, fall back to the lexical path — consistent with its declared Effect.Effect<string> (no error channel) contract. The other callers (instruction discovery, project copy, repository cache) equally want a best-effort path, not a crash.
Actual
Any non-NotFound realPath error propagates through Effect.orDie, turning an advisory lookup into a fatal fiber defect.
Environment
- opencode version: dev
- platform: Windows (protected/system directories), also reproducible on POSIX with ELOOP / permission-denied paths
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.