Skip to content

fix(web): build agent search queries as IR - #1573

Merged
brendan-kellam merged 5 commits into
mainfrom
brendan/fix-SOU-1960
Aug 13, 2026
Merged

fix(web): build agent search queries as IR#1573
brendan-kellam merged 5 commits into
mainfrom
brendan/fix-SOU-1960

Conversation

@brendan-kellam

@brendan-kellam brendan-kellam commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Fixes SOU-1960
Fixes SOU-1778

Summary

  • build grep and glob searches as QueryIR instead of interpolating structured tool inputs into query-language strings
  • preserve regex, literal path, exact repository scope, and branch semantics without re-lexing values containing spaces, commas, or quotes
  • add focused query-builder regressions and tool-level coverage that verifies both tools use queryType: ir

Testing

  • yarn workspace @sourcebot/web test --run
  • yarn workspace @sourcebot/web lint

Note

Cursor Bugbot is generating a summary for commit 4467620. Configure here.

Summary by CodeRabbit

  • Bug Fixes

    • Improved grep and glob searches so spaces, commas, quotes, punctuation, and escaped paths are interpreted correctly.
    • Preserved repository, branch, filename, and path filters during structured searches.
    • Improved handling of selected repositories, all-branch searches, and searches containing only file content or glob patterns.
  • Documentation

    • Added an unreleased changelog entry documenting the search parsing fixes.

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 265310c4-37dd-4281-b46b-5bcc6a8b3dba

📥 Commits

Reviewing files that changed from the base of the PR and between 379ce89 and 927d1dd.

📒 Files selected for processing (2)
  • packages/web/src/features/tools/glob.test.ts
  • packages/web/src/features/tools/grep.test.ts

Walkthrough

Grep and glob tools now construct structured QueryIR searches. The change preserves spaces, punctuation, quotes, repository names, and branch references. Both tools execute IR queries and no longer include generated query strings in metadata.

Changes

Structured search query migration

Layer / File(s) Summary
QueryIR builder implementation
packages/web/src/features/tools/searchQuery.ts, packages/web/src/features/tools/searchQuery.test.ts
Added grep and glob query builders for content, filename, path, glob, repository, and branch constraints. Tests cover structured inputs and special characters.
Grep and glob tool integration
packages/web/src/features/tools/grep.ts, packages/web/src/features/tools/glob.ts, packages/web/src/features/tools/grep.test.ts, packages/web/src/features/tools/glob.test.ts, CHANGELOG.md
Updated both tools to execute IR queries and removed generated query metadata. Added execution tests and documented the parsing fix.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Mergeability Score: ⚪ Minimal · up to 927d1

The PR changes search query construction to preserve structured grep and glob semantics without re-lexing values; no actionable merge-blocking risk remains at the current head, so it is merge-ready after normal checks.

Sequence Diagram(s)

sequenceDiagram
  participant AgentTool
  participant QueryBuilder
  participant SearchService
  AgentTool->>QueryBuilder: Build structured QueryIR
  QueryBuilder-->>AgentTool: Return QueryIR
  AgentTool->>SearchService: Execute with queryType ir
  SearchService-->>AgentTool: Return search results
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: building agent search queries as QueryIR in the web package.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch brendan/fix-SOU-1960

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@brendan-kellam
brendan-kellam merged commit d78054b into main Aug 13, 2026
12 of 13 checks passed
@brendan-kellam
brendan-kellam deleted the brendan/fix-SOU-1960 branch August 13, 2026 04:56
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.

1 participant