Agents sometimes hardcode wrong absolute paths -> NotFound: FileSystem.access on Bash/Read tools

Author: jwcrystalCreated Sep 7, 2026Updated Sep 14, 2026

Summary

When an oh-my-opencode-slim agent (e.g. @orchestrator) dispatches a Bash/Shell or Read tool, it occasionally hardcodes an incorrect absolute path (a path that doesn't exist). OpenCode then calls fs.access on that path before running the tool and Bun throws:

NotFound: FileSystem.access (/Users/<user>/Documents/Workspace/<ProjectName>)

where the real cwd is e.g. /Users/<user>/Documents/Workspace/<ParentDir>/<ChildDir>/<ProjectName> (a <ParentDir>/<ChildDir>/ segment was dropped by the model).

Example

  • Tool: npx vitest run --config vitest.contract.config.ts apps/api/src/pilot/pilot.contract.test.ts
  • Error: NotFound: FileSystem.access (/Users/<user>/Documents/Workspace/<ProjectName>) — wrong path, missing a directory segment
  • A parallel command using relative paths (pwd && ls apps/api/src/pilot) succeeded fine

So this is the model guessing a wrong absolute path rather than a plugin/permission problem.

Related but different

  • #276 was about apply_patch absolute-path blocking and is fixed. This issue is broader: it hits any file tool (Bash/Shell, Read, Glob) when the model writes a wrong absolute path, and it fails hard (NotFound) instead of being rescued.

Mitigation already made locally

Added a rule to the @orchestrator prompt (in buildOrchestratorPrompt's "Dispatch efficiency" section):

Use relative paths (e.g. src/app.ts), never hardcode absolute paths; when unsure of the working directory, run pwd first

This is a prompt-level mitigation (probabilistic). It does not hard-guarantee the model will comply.

Question / suggestion

Would it make sense to add a hard defense at the tool/hook layer — e.g. detect tool args containing an absolute path that does not exist and is under the workspace, then normalize to workspace-relative (or rewrite the error to hint pwd)? That would be a deterministic fix for this class of NotFound: FileSystem.access failures.

Happy to open a PR if the maintainers think the hook-layer defense is worth adding.

Source: alvinunreal/oh-my-opencode-slim