Skip to content

feat: add first-class grep tool - #1542

Merged
avoidwork merged 3 commits into
mainfrom
feat/first-class-grep-tool
Oct 26, 2026
Merged

avoidwork merged 3 commits into
mainfrom
feat/first-class-grep-tool

Conversation

@avoidwork

@avoidwork avoidwork commented Oct 26, 2026 •

Copy link
Copy Markdown
Owner

Description

Implements the first-class-grep-tool OpenSpec change (issue #1540). Adds a dedicated grep tool for literal regex search across files, registers it across all four registration points in src/tools/index.js (TOOL_PERMISSIONS, TOOL_CLASSIFICATIONS, ORCHESTRATOR_TOOLS, TOOLS), and removes the redundant search action from the file tool so grep is the single grep entry point.

The grep tool reuses the existing grepImpl/nativeSearch logic from the file tool (DRY) rather than duplicating search code. A postinstall patch (scripts/patch-deepagents-grep.mjs) drops grep from deepagents' BUILTIN_TOOL_NAMES — the library's own grep is excluded via excludedTools, so the custom grep tool name no longer collides with an unused built-in.

Type of Change

  • New feature (non-breaking change which adds functionality)
  • Bugfix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactor (no functional changes)
  • Performance improvement
  • CI / build / tooling

Testing

  • tests/unit/tools/grep.test.js — schema validation (pattern required; path/maxResults optional), matches found, no matches, native fallback, path validation against the sandbox allowlist.
  • tests/unit/tools/file.test.js — updated to remove search action references.
  • tests/unit/tool_index.test.js — added grep to the expected tools list.
  • tests/integration/tools/file.test.js — updated the search test to use grepImpl.
  • Full suite: 4355 tests pass, 0 failures. Coverage maintained (90.53% line).

Coverage

  • Line coverage maintained

Checklist

  • npm run lint passes
  • Tests pass with maintained line coverage
  • No forbidden patterns used
  • Conventional Commit style applied

Closes #1540

Adds OpenSpec change first-class-grep-tool covering a dedicated grep tool,
its registration in src/tools/index.js, and removal of the redundant search
action from the file tool.
@avoidwork avoidwork self-assigned this Oct 26, 2026
Adds the grep tool implementation for the first-class-grep-tool OpenSpec
change: a dedicated grep tool at src/tools/grep/index.js that reuses the
file tool's grepImpl/nativeSearch logic, registered across all four
registration points (TOOL_PERMISSIONS, TOOL_CLASSIFICATIONS,
ORCHESTRATOR_TOOLS, TOOLS). Removes the redundant search action from the
file tool so grep is the single grep entry point.

Patches deepagents' BUILTIN_TOOL_NAMES to drop grep, which is excluded
via excludedTools, so the custom grep tool name no longer collides with
the library's built-in (unused) grep tool.
@avoidwork
avoidwork merged commit 1a05822 into main Oct 26, 2026
2 checks passed
@avoidwork
avoidwork deleted the feat/first-class-grep-tool branch October 26, 2026 23:36
@avoidwork avoidwork mentioned this pull request Oct 26, 2026
7 of 12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add first-class grep tool

1 participant