Skip to content

fix(copilot): bound agent CLI grep matching - #8338

Merged
waleedlatif1 merged 2 commits into
stagingfrom
codex/grep-linear-regex
Sep 26, 2026
Merged

waleedlatif1 merged 2 commits into
stagingfrom
codex/grep-linear-regex

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Sep 26, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Use the shared linear-time regex helper for agent CLI grep, with literal matching for unsupported patterns.
  • Yield during scans and enforce a five-second scan budget after resource reads so searches can be cancelled and incomplete counts are not reported as complete.
  • Bound context collection to the remaining output limit, skip overlapping windows, and reuse match results when rendering output.

Type of Change

  • Bug fix

Testing

  • 236 tests across universal-grep.test.ts, linear-regex.test.ts, and operations.test.ts.
  • Four regressions verified against the original code and by independently removing each guard.
  • Context-window regression verifies a dense file completes within the scan budget while preserving output ordering and the full match count.
  • App type-check, lint, block-registry check, check:audits, and docs-manifest check.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Sep 26, 2026 9:18pm UTC

Request Review

@greptile-apps

greptile-apps Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[High risk] Adds regex validation and scan-time limits to grep matching.

The PR appears safe to merge; no new actionable issue was found, and the previous context-expansion finding is resolved.

Summary

The PR switches agent CLI grep to bounded regex matching, adds scan cancellation and a time budget, and now caps context expansion while continuing to count matches. The latest change adds a dense-file regression test for overlapping context windows.

Reviews (2) · Last reviewed commit: "fix(copilot): bound grep context expansi..."

@cubic-dev-ai cubic-dev-ai 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.

No issues found across 2 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

Comment thread apps/sim/lib/mothership/agent-cli/engines/universal-grep.ts
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai 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.

No issues found across 2 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit d9b9e1d into staging Sep 26, 2026
23 of 24 checks passed
@waleedlatif1
waleedlatif1 deleted the codex/grep-linear-regex branch September 26, 2026 21:21

This branch was previously deployed

1 inactive deployment
Preview — 856b5545 Deployed Sep 26, 2026 by vercel[bot]
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