anomalyco / anomalyco/opencode

glob tool fails on paths with tilde (~) expansion

Open
#38,497 1 comment 0 reactions 1 assignee View on GitHub

@nexxeln is already working on this.

Since Jul 23, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

The glob tool does not expand ~ (tilde) in the path parameter. Node.js's path.isAbsolute() returns false for paths starting with ~, causing them to be resolved relative to the instance directory instead of the user's home directory.

Steps to reproduce:

  1. Run glob with path: ~/.config/opencode
  2. Observe: ripgrep execution failed

Expected behavior:
~ and ~/ should be expanded to the user's home directory before resolution.

Root cause:
In packages/opencode/src/tool/glob.ts, line 39:

search = path.isAbsolute(search) ? search : path.resolve(ins.directory, search)

path.isAbsolute(~/.config) returns false, causing the path to be resolved relative to ins.directory.

Tilde expansion already exists elsewhere in the codebase (shell.ts, permission/index.ts) but is missing in the glob tool.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.