Skip to content

feat(tools): Return a params summary instead of full schemas from searchTools - #3496

Merged
MathurAditya724 merged 2 commits into
mainfrom
feat/slim-tool-search-results
Nov 16, 2026
Merged

MathurAditya724 merged 2 commits into
mainfrom
feat/slim-tool-search-results

Conversation

@sentry-junior

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

Copy link
Copy Markdown
Contributor

Refs #2893 (recommendation 4 only).

searchTools returned the full input_schema and annotations for every result, so each search paid for the schemas of tools the model never called.

  • The best match of a query keeps its full input_schema.
  • Other results, and every result of a source listing, get params: a TypeScript-like summary from summarizeInputSchema, such as repo: string, number: integer, content: "+1" | "-1" | .... ? marks an optional param. Enum values and nested object shapes stay; param descriptions and constraints do not.
  • annotations is gone. call_notes is omitted when empty.
  • The searchTools description says to search a tool's exact name to get its full schema. In the GitHub, memory, and tracker catalogs, every deferred tool ranks first for its own name.

Result size on the GitHub plugin catalog (~4 chars per token):

Search Before After
source github, 5 results 4,695 chars (~1.2k tokens) 1,653 chars (~410)
source github, all 15 13,601 chars (~3.4k) 4,727 chars (~1.2k)
get issue details, 3 results 2,334 chars (~580) 1,406 chars (~350)
create a new GitHub issue, 1 result 1,117 chars 997 chars

Ranking does not change, so the tool-search classifier eval is not affected. It was not run here (no model credentials).

Open question: the issue also suggests returning the full schema when executeTool validation fails. This PR does not do that. Zod tool errors already name up to 5 bad fields with their expected values, and an exact-name search returns the schema. If agents still guess arguments wrong for non-top results, attach the schema to the executeTool input error in pi-tool-adapter.ts.

via @MathurAditya724.

--

View Session [Sentry]

@vercel

vercel Bot commented Nov 16, 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 16, 2026 8:54am UTC

Request Review

@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

27 screenshot changes — 27 changed · 0 added · 0 removed

Review screenshots in Frameshift

Automation Skill Editor · Desktop
Automation Skill Editor · Desktop
Changed
Automations Runs Filters · Desktop
Automations Runs Filters · Desktop
Changed
Conversation Attachment · Desktop
Conversation Attachment · Desktop
Changed
Conversation Attachment · Mobile
Conversation Attachment · Mobile
Changed
Conversation Attachment Modal · Desktop
Conversation Attachment Modal · Desktop
Changed
Conversation Attachment Zoom · Desktop
Conversation Attachment Zoom · Desktop
Changed
Show 12 more changed screenshots
Conversation Attachment Zoom · Mobile
Conversation Attachment Zoom · Mobile
Changed
Conversation Child Agents · Desktop
Conversation Child Agents · Desktop
Changed
Conversation Details Watched Linked Work · Desktop
Conversation Details Watched Linked Work · Desktop
Changed
Conversation Event Log · Mobile
Conversation Event Log · Mobile
Changed
Conversation Long Transcript Touch · Mobile
Conversation Long Transcript Touch · Mobile
Changed
Conversation Memory List Jump · Desktop
Conversation Memory List Jump · Desktop
Changed
Conversation Memory List Jump · Mobile
Conversation Memory List Jump · Mobile
Changed
Conversation Object Links · Desktop
Conversation Object Links · Desktop
Changed
Conversation Question Picks And Text · Desktop
Conversation Question Picks And Text · Desktop
Changed
Conversation Share Details · Desktop
Conversation Share Details · Desktop
Changed
Conversation Task Line · Desktop
Conversation Task Line · Desktop
Changed
Settings · Desktop
Settings · Desktop
Changed

9 more changed screenshots in Frameshift.

@sentry-junior sentry-junior Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked the claims I could check. Every deferred tool in the GitHub, memory, Vercel, and core catalogs ranks first for its own exact name and returns input_schema (39 tools). summarizeInputSchema renders none of them as unknown. The search-result shape has no other consumers to update: tool-search-harness reads only tool_name, and searchMcpTools has its own shape. Dropping annotations is safe, because the action-review gate reads them from the tool definition (guardian/gate.ts:198, :373) and no prompt mentions them.

Two things before this lands:

  • params drops every param describe(), and policies/tool-design.md puts behavior there: null-as-command, rules that tie fields together, and value formats. For example, searchTools({query: "pause automation"}) returns updateAutomation as params only: instruction?: string | null, skill?: string | null, context?: string | null, …. Every other null means "keep", but a null context removes it (automations/tools/update.ts:318-321, :375). That call passes validation, so Zod errors cannot repair it. The Code Mode hint (codemode/tool.ts:158) now says to call a result "with the arguments that its input_schema or params lists", which tells the model it can call a params-only tool directly. Make params a preview for picking a tool: in the searchTools description (search-tools.ts:633) and the Code Mode hint, say to search the exact name for input_schema before you call a tool that came back with params only.
  • This changes what the model reads to build executeTool and script calls, but no agent-facing eval ran. Behavioral evals were skipped because their path filter does not include search-tools.ts or codemode/, and the tool-search eval checks only ranking. Add the trigger-evals-behavioral label before you merge. coding/subscriptions.eval.ts already checks a deferred executeTool call to github_updatePullRequest.

@sentry-junior

sentry-junior Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

Addressed the review in 2e578eb. The searchTools description and the Code Mode <script-tools> hint now say that params is only a preview for choosing a tool. Before calling a tool that came back with params only, the model searches its exact name to get the input_schema. Also added trigger-evals-behavioral so the behavioral evals run on this PR.

@MathurAditya724
MathurAditya724 marked this pull request as ready for review November 16, 2026 10:49
@github-actions github-actions Bot added the risk: high PR risk score: high label Nov 16, 2026
@MathurAditya724
MathurAditya724 merged commit 27bbf49 into main Nov 16, 2026
52 of 62 checks passed
@MathurAditya724
MathurAditya724 deleted the feat/slim-tool-search-results branch November 16, 2026 11:01
MathurAditya724 added a commit that referenced this pull request Nov 17, 2026
Follow-up to #3496. The `params` preview showed "No
arguments." for tools whose input is a root union, like
`slackListUpdateItem`, and showed params with defaults as required. This
fixes both, rewrites the searchTools description so it matches how
discovery works now, and shares the preview hint with the Code Mode
hint.

It also updates the deferred tool discovery spec to describe the
`params` preview, fixes two stale comments left from
#3494, and makes automation card details use the shared
Slack external ref id schema.

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

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:agent%3Afb8931822e52792d37f63497ad7ad63d -->

--

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

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

---------

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: Aditya Mathur <[email protected]>
dcramer added a commit that referenced this pull request Nov 17, 2026
We are dropping OpenSpec. Committed plans go stale: half of the plans in
`openspec/changes/` describe work that is already done (see
#3517), and agents read stale plans as current intent.
Code, tests, and `policies/` already own the contract, so planned work
goes in GitHub issues.

Docs and agent tooling only. No runtime code changes.

- Delete `openspec/`, which holds `config.yaml`, its README, and all
four plans under `changes/`.
- Delete the `/opsx:propose` and `/opsx:apply` commands in
`.claude/commands/` and `.cursor/commands/`.
- Remove the `openspec/changes/` references from `AGENTS.md`,
`CONTRIBUTING.md`, and `policies/README.md`. `AGENTS.md` now says: do
not commit implementation plans, and track planned work in GitHub
issues.

The two plans that are still active are deleted too. Git history keeps
them:
- `actor-identity-end-state`: its rollout rules point at
#2439, which can hold whatever is still needed.
- `deferred-tool-discovery`: no task boxes are checked, but
`searchTools` already has the `source` filter and params summaries
(#3496).

This overlaps with #3517, which deletes two of these
plans and edits `CONTRIBUTING.md`. Whichever PR merges second needs a
small rebase.

`CHANGELOG.md` still mentions OpenSpec. That is release history, so it
stays.

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

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:slack%3AC0CHB3YHES2%3A1794853763.133949 -->

--

[View
Session](https://junior-prod.sentry.dev/conversations/slack%3AC0CHB3YHES2%3A1794853763.133949)
[[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3AC0CHB3YHES2%3A1794853763.133949/?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 — 2e578eb5 Deployed Nov 16, 2026 by vercel[bot]
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.

1 participant