Skip to content

ref(sandbox): Remove grep, findFiles, and listDir tools - #2896

Merged
dcramer merged 1 commit into
feat/defer-rare-toolsfrom
feat/remove-sandbox-search-tools
Nov 7, 2026
Merged

dcramer merged 1 commit into
feat/defer-rare-toolsfrom
feat/remove-sandbox-search-tools

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Stacked on #2895. Answers the question in this comment: the sandbox search tools duplicate bash, so remove them instead of deferring them.

bash is loaded on every Turn and already covers these with rg, find, and ls. ripgrep stays in the sandbox image. The separate tools only add tool-list cost and a second search path to maintain.

Removed

  • grep, findFiles, listDir: tool files, sandbox dispatch, input normalization, and registration.
  • The search-only helpers in file-utils.ts, the commandRunner on the file-tool call context, and the setToolCallSpanAttributes hook that only search used.
  • app.sandbox.search.* span attributes and their TELEMETRY.md query.

Kept

  • readFile, editFile, writeFile. They give bounded reads with continuation and exact edits with diffs, and bash does not do that well.
  • The sandbox catalog source now holds only createPreview, so its description covers only preview URLs.

Tests

  • The sandbox recovery and stream-interruption tests now use readFile instead of grep/findFiles. They test the same behavior.
  • I deleted the ripgrep-specific cancellation test. It tested a path that no longer exists, and bash has its own cancellation coverage.

Unit, component, and integration tests, typecheck, and lint all pass.

via @dcramer.

--

View Session [Sentry]

bash already covers these with rg, find, and ls. The model sees bash on
every Turn, so the separate search tools only add tool-list cost and a
second path to maintain.

Keep readFile, editFile, and writeFile: they give bounded, structured
reads and exact edits that bash does not.

Co-Authored-By: David Cramer <[email protected]>
@vercel

vercel Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
junior-docs Ready Ready Preview Nov 7, 2026 6:56pm UTC

Request Review

@dcramer
dcramer merged commit 3abc39a into main Nov 7, 2026
35 checks passed
@dcramer
dcramer deleted the feat/remove-sandbox-search-tools branch November 7, 2026 19:05
dcramer added a commit that referenced this pull request Nov 7, 2026
Every direct tool puts its schema in every Turn, and most direct tools
are rarely called. This change moves 31 rarely used tools to the
deferred catalog. `searchTools` finds them and `executeTool` runs them.

**How I picked them.** I looked at recent tool-call telemetry. A tool
stays direct when many Conversations call it, or when the system prompt
or runtime context names it. Everything else is deferred.

**Deferred now, grouped by catalog source:**
- `sandbox`: `grep`, `findFiles`, `listDir`, `createPreview`. #2896,
stacked on this PR, deletes the 3 search tools because `bash` covers
them.
- `slack`: the 4 canvas tools, the 4 `slackList*` tools,
`slackChannelJoin`, `addReaction`
- `images`: `imageGenerate`, `publishImage`, `unpublishImage`
- `resource-watches`: `searchEventTypes`
- `automations`: `createAutomation`, `searchAutomations`,
`updateAutomation`, `deleteAutomation`, `runAutomationNow`
- `agents`: `searchAgents`, `stopAgent`
- `workspaces`: `createWorkspace`, `updateWorkspace`, `deleteWorkspace`
- `user-customization`: `updateUserCustomization`
- GitHub: `github_commentOnPullRequest`,
`github_submitPullRequestReview`

**Still direct:**
- Frequent: the `bash` and file tools, `loadSkill`, `switchWorkspace`,
`listWorkspaces`, web search and fetch, Slack thread, channel, and
public search reads, `userLookup`, `updatePlan`, `reportProgress`,
`viewImage`, `systemTime`.
- GitHub: `github_createPullRequest`,
`github_updatePullRequestFeedback`,
`github_resolvePullRequestReviewThread`. PR maintenance Turns call these
often.
- Named by the system prompt or runtime context: `addReviewItem`,
`watchEvents`, `loadAttachment`.
- Common behavior that the model skips if it must search first:
`sendFiles` and `watchTimer`.
- The `modelOnly` runtime tools do not change.

**Other changes:**
- Each deferred group gets a catalog `source`, so the `searchTools`
description lists it. Without a source, the model can find a tool only
by guessing a query.
- The `executeTool` description now says to use it for a tool that is
not in the tool list but that a skill, tool result, or error names.
Examples are the GitHub egress denials and the `github-code` skill text.
A direct call to a deferred tool fails with "Tool X not found".
- `policies/tool-design.md` gets a rule for when a tool is direct.

**Not in this PR:** the ranking and result-format fixes for
`searchTools` (#2893). With more tools deferred, those fixes matter
more, so they come next.

**Checks:** `pnpm typecheck`, `pnpm lint`, the tool checks,
`skills:check`, and the junior and junior-github test suites pass. I did
not run the LLM evals locally.

Refs #2893

<!-- junior-request-attribution:start -->
via @dcramer.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:slack%3AC0B595QDZLL%3A1794073929.368779 -->

--

[View
Session](https://junior-prod.sentry.dev/conversations/slack%3AC0B595QDZLL%3A1794073929.368779)
[[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3AC0B595QDZLL%3A1794073929.368779/?project=4510944073809921)

<!-- junior-session-footer:end -->

---------

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: David Cramer <[email protected]>

This branch was successfully deployed

1 active deployment
Preview – junior-docs — 92a829cb Deployed Nov 7, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: high PR risk score: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant