Skip to content

improvement(agent-cli): skip non-text files in grep instead of marking the search incomplete - #9635

Merged
waleedlatif1 merged 1 commit into
stagingfrom
improvement/grep-skip-binary
Nov 3, 2026
Merged

waleedlatif1 merged 1 commit into
stagingfrom
improvement/grep-skip-binary

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Agent grep fetched /files/{id}/text for every listed file, so fonts, video, images, and archives each raised "could not read text" and turned an otherwise complete search into exit 1 "Search incomplete"
  • Files are now checked against workspaceFileTextFormat (the same gate the agent's text read applies) before fetching; non-text files are skipped unread and reported as one Skipped N files with no searchable text … stderr line that does not fail the search
  • PDF/DOCX/XLSX and plain-text sources still pass the gate and are searched
  • Skipped files no longer consume the 300-file read budget; real read failures, the cap, degraded/truncated extraction, and secret-provenance withholding still report incomplete
  • --in naming a non-text file returns "No matches" plus the skip note, not "Unknown --in selector"
  • Project grep applies the same skip using the Project text read's gate

Type of Change

  • Improvement

Testing

  • New tests in universal-grep.test.ts (4) and project-file-grep.test.ts (1), all red before the fix, green after; 50/50 pass across both files
  • bun run lint; type-check and audits left to CI

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 Nov 3, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
docs Ready Ready Preview Nov 3, 2026 8:51pm UTC

Request Review

@greptile-apps

greptile-apps Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] This PR appears safe to merge.

Summary

Agent grep now skips unsupported file formats before reading them in workspace and Project searches.

  • Grep skips files without text extractors and keeps searching readable files.

No actionable issues found. Tests were inspected but not run.

Reviews (1) · Last reviewed commit: "improvement(agent-cli): skip non-text fi..." · Reviewed by Greptile

@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 4 files

Confidence score: 5/5

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

Turn on auto-fix | Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit 781c896 into staging Nov 3, 2026
78 checks passed
@waleedlatif1
waleedlatif1 deleted the improvement/grep-skip-binary branch November 3, 2026 22:11

This branch was successfully deployed

1 active deployment
Preview — 548512f9 Deployed Nov 3, 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