Repository navigation
ref(sandbox): Remove grep, findFiles, and listDir tools - #2896
Merged
Merged
Conversation
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]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
dcramer
approved these changes
Nov 7, 2026
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]>
23 tasks done
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #2895. Answers the question in this comment: the sandbox search tools duplicate
bash, so remove them instead of deferring them.bashis loaded on every Turn and already covers these withrg,find, andls. 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.file-utils.ts, thecommandRunneron the file-tool call context, and thesetToolCallSpanAttributeshook that only search used.app.sandbox.search.*span attributes and theirTELEMETRY.mdquery.Kept
readFile,editFile,writeFile. They give bounded reads with continuation and exact edits with diffs, andbashdoes not do that well.sandboxcatalog source now holds onlycreatePreview, so its description covers only preview URLs.Tests
readFileinstead ofgrep/findFiles. They test the same behavior.bashhas its own cancellation coverage.Unit, component, and integration tests, typecheck, and lint all pass.
via @dcramer.
--
View Session [Sentry]