Skip to content

Glob tool returns zero results when broken symlinks exist in the search tree #24972

@aaronkyriesenbach

Description

@aaronkyriesenbach

Description

The glob tool silently returns zero results when any broken symlink (or permission-denied path) exists anywhere in the directory tree being searched. This happens because Ripgrep.files() treats ripgrep exit code 2 as fatal and discards all stdout output, even though valid file paths were already emitted.

The search() function (used by the grep tool) already handles this correctly — it passes --no-messages and treats exit code 2 as non-fatal (returning partial: true). The files() function was missed.

Plugins

oh-my-openagent@latest

OpenCode version

1.14.28

Steps to reproduce

  1. Create a broken symlink anywhere in your home directory (or have one from a package manager like pnpm, Firefox lock files, etc.)
  2. Use the glob tool to search for a file that exists
  3. Glob returns zero results despite the file existing

Common sources of broken symlinks: pnpm stores pointing to deleted git worktrees, browser lock files, AUR/paru cache with restricted permissions.

Operating System

Arch Linux (kernel 6.14.4)

Terminal

Kitty

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions