Skip to content

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

Closed

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.

Activity

  1. github-actions commented on Jan 27, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    Both issues involve bash tool path resolution issues on Windows and missing external dependencies/binaries. While #10871 focuses on Git Bash auto-detection, #10872 addresses a related path resolution problem when realpath is unavailable. They may share root causes around Windows path handling in the bash tool.

    Feel free to ignore if your specific case differs.

  2. MaxMiksa commented on Jan 27, 2026

    @MaxMiksa
    ContributorAuthor

    Thanks! Related to Windows bash/tooling, but this one is distinct: bash tool external-directory detection currently relies on an external realpath binary. In environments where realpath isn’t available (common on Windows), the external_directory prompt can be skipped.

    PR #10874 removes the external dependency by using internal path.resolve + fs.realpath fallback and adds a regression test.

  3. github-actions commented on Mar 30, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions