anomalyco / anomalyco/opencode
glob tool fails on paths with tilde (~) expansion
@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:
- Run glob with path:
~/.config/opencode - 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
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.