Skip to content

Workspace.search returns nothing, without an error, when rg is missing on the client #15112

Open

Description

@langri-sha

When rg isn't on the client's PATH, Workspace.search falls back to grep (engine/client/filesync.go, searchHostPath → searchWithGrep, v1.0.0-beta.25). Globs become grep --include, which has no brace expansion or ! negation, so *.{test,spec}.ts matches nothing, grep exits 1, and the search returns [] without an error.

dagger/vitest v0.3.0 finds test files this way. On stock ubuntu:24.04 with one failing test, dagger check lists 3 checks and exits 0; after apt-get install ripgrep it lists 5 and exits 1.

Please fail loudly when rg is missing.

Activity

  1. pcbeingused333 commented on Nov 9, 2026

    @pcbeingused333
    Contributor

    I'd like to work on this. searchWithGrep in engine/client/filesync.go passes each glob to grep --include, which doesn't understand {a,b} or !, and exit status 1 is then read as "no matches", so the caller gets an empty result.

    The fix I have in mind follows your request: return a clear error saying ripgrep is required when a glob uses syntax the grep fallback can't honor, instead of an empty result, plus a unit test with *.{test,spec}.ts. Happy to adjust if you'd rather handle it differently.

    (Written with AI assistance.)

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions