Skip to content

fix(core): surface malformed glob errors from ripgrep - #56518

Closed
rudycelekli wants to merge 3 commits into
anomalyco:devfrom
rudycelekli:malformed-glob
Closed

rudycelekli wants to merge 3 commits into
anomalyco:devfrom
rudycelekli:malformed-glob

Conversation

@rudycelekli

@rudycelekli rudycelekli commented Oct 17, 2026 •

Copy link
Copy Markdown

Issue for this PR

Closes #47474

Type of change

  • Bug fix

What does this PR do?

Report ripgrep’s malformed-glob diagnostics instead of presenting an empty successful search. Keep valid no-match searches and other exit-2 partial results intact.

How did you verify your code works?

  • Real ripgrep service regression: an invalid ignore-file glob plus a broken symlink produced two failures on the prior PR head; both pass with the narrower CLI-diagnostic match. Existing malformed CLI-glob and valid no-match controls remain.
  • Source-bound Linux qualification: full Core suite 6,340 passed, 345 skipped, zero failures; Core typecheck and root bun run check (34 tasks) passed.
  • The two broken-file-symlink fixtures explicitly skip Windows because test-runner privileges are not guaranteed. This run does not establish native Windows behavior.

Screenshots / recordings

No visual UI code changed; behavior is asserted directly.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix works for the reported case, but as written it breaks some searches that work today.

How I checked: your two new tests fail on the base and pass with this change (29/29 in ripgrep.test.ts and tool-search.test.ts), and the packages/core typecheck passes. I also ran ripgrep by hand and with a temporary test against both branches.

Public API: unchanged.

The problem: ripgrep prints the same error parsing glob text for a bad line in a project's .gitignore or .ignore, and then keeps searching. If anything else in the same run makes ripgrep exit 2, such as a broken symlink with follow: true, the new check discards the results. With a .ignore containing [ plus a broken symlink, glob and find return [a.ts] on the base but fail with Ripgrep.Error on this branch. find backs Search.find. grep isn't affected because it passes --no-messages. Details are in the inline comment.

Comment thread packages/core/src/ripgrep.ts Resolved
@github-actions

Copy link
Copy Markdown
Contributor

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Search tools report malformed glob patterns as successful empty results

1 participant