Skip to content

bash tool: external_directory prompt skipped when realpath is missing #10872

@MaxMiksa

Description

@MaxMiksa

Description

The bash tool tries to detect when a command targets paths outside the project directory to request external_directory permission. Current path resolution relies on an external realpath binary, which is not reliably available on Windows / some environments, so the external directory prompt can be skipped.

Plugins

N/A

OpenCode version

dev (local checkout @ 213c0e18a, package packages/opencode v1.1.36)

Steps to reproduce

  1. Run in an environment where realpath is not present on PATH (common on Windows)
  2. Execute a bash tool command that leaves the project directory (e.g. cd ..)
  3. Observe whether an external_directory permission request is issued

Operating System

Windows 11

Terminal

Windows Terminal

Expected

Even without realpath, Opencode should still resolve candidate target paths (e.g. via path.resolve) and request external_directory permission when leaving Instance.directory.

Actual

Path resolution fails silently when realpath is missing, resulting in no external_directory permission request for commands like cd .. / file operations targeting outside directories.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions