Skip to content

fix(buzz-dev-mcp): use regex in bundled rg fallback - #7555

Open
gokay-ai wants to merge 1 commit into
block:mainfrom
gokay-ai:cursor/rg-fallback-regex-ab5a
Open

gokay-ai wants to merge 1 commit into
block:mainfrom
gokay-ai:cursor/rg-fallback-regex-ab5a

Conversation

@gokay-ai

Copy link
Copy Markdown

Summary

The bundled rg fallback used substring matching, so patterns like alpha|beta silently matched nothing. It now compiles the pattern once with the regex crate (honoring -i) and writes unsupported-flag / invalid-regex errors to stderr with exit 2.

Fixes #7472

Testing

cargo test -p buzz-dev-mcp covers literal match, alpha|beta alternation, -i, unsupported flags, and invalid regex.

The bundled rg matcher used substring contains(), so patterns with
metacharacters like alpha|beta silently matched nothing. Compile the
pattern once with the regex crate (honoring -i) and write usage errors
to stderr so callers see unsupported flags and invalid regexes.

Signed-off-by: GokayAI <60583610+gokay-ai@users.noreply.github.com>

Co-authored-by: GokayAI <gokay-ai@users.noreply.github.com>
@gokay-ai
gokay-ai requested a review from a team as a code owner September 10, 2026 10:28
Copilot AI lite review requested due to automatic review settings September 10, 2026 10:28

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

Copy link
Copy Markdown

🔐 Codex Security Review

Status: review required for the current range.

The current range is 051c3a270be9c73da9ab06700bcab7d5552fceaa...3f41c7ffb99abb6f9757073314a67c2b71bc641b.
A new review must complete for this exact range. When manual authorization
is required, a Block organization member must comment exactly
@buzz-security-review 3f41c7ffb99abb6f9757073314a67c2b71bc641b to authorize a new review.
Any previous review applies only to its recorded range.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

buzz-dev-mcp bundled rg fallback silently treats regex patterns as literals — false negatives on any metacharacter pattern

2 participants