Repository navigation
fix(server): trim tool and parameter descriptions under client context caps - #486
Merged
Merged
Conversation
…t caps Every client loads all tool descriptions at connect time. Kiro's power activation renders them into one tool result capped at 30,000 chars; ours was ~41,000, so Kiro truncated it to a 500-char preview and the agent guessed tool names that do not exist. Rewrites descriptions toward the documented budget (tool <=200 chars, param <=120): shared precondition constants, standalone description constants, and the capability-registry tools. Every routing rule is kept (listProducts first, ask on a clash, describe before invoke, weak_match re-search, '*' browse, paging, user_permission for writes, deletes refused), and every phrase pinned by tests is unchanged. Rendered size of the 44 hosted tools: 41,351 -> 27,512 chars. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
SavioBS629
marked this pull request as draft
October 14, 2026 14:08
Shorten Percy setup/scan parameter text and the createTestCase / updateTestCase parameter text without changing their meaning. Saves ~500 tokens on the 52-tool list. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
sarve-shreyas
marked this pull request as ready for review
October 21, 2026 10:40
Conflicts resolved: - tool-handoff.ts (a11y scan/config id hints), accessibility.ts (fetchAccessibilityIssues sources), applive.ts (dynamic description): took main; main's text is newer behaviour and already short. - capability-registry/register.ts (invokeCapability): kept the trimmed wording and added main's new `select`/`narrowable` rule. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
After merging main, the hosted tool set measured ~30,070 chars, just over Kiro's 30,000 activation cap, mostly from the new accessibility report sources and invokeCapability's `select`. Shortens those parameter descriptions (fetchAccessibilityIssues, startAccessibilityScan, invokeCapability, setupBrowserStackAppAutomateTests, askBrowserStackAI) while keeping every source pointer and default. Hosted set: ~29,340 chars. Local 52-tool set: ~32,760. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The trimmed descriptions dropped the prose telling the model to turn "newest"/"most recent" into "latest" and "earliest"/"first" into "oldest", and the code only matches those two exact strings. Move the mapping into the schema with a shared versionString() (z.string() .transform), as CLAUDE.md prefers, so it holds whatever the model sends. Applied to runBrowserLiveSession (desiredOSVersion, desiredBrowserVersion), runAppLiveSession and takeAppScreenshot (desiredPlatformVersion). Matching is case- and whitespace-insensitive; version numbers and names such as "Sequoia" pass through unchanged. The advertised JSON schema is unchanged (type string, same description). Verified over MCP: desiredOSVersion "newest" + desiredBrowserVersion "most recent" resolve to Windows 11 / Chrome 156.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gaurav-singh-9227
previously approved these changes
Oct 30, 2026
…on budget - searchCapability: paging stops when next_offset is absent - invokeCapability: page with the capability's own parameter, not offset - tool handoff: no tool lists projects, so use the capability functions - askBrowserStackAI: read-only runs return changes in needs_approval - setupPercyVisualTesting: only for projects that already have Percy - updateTestCase: list cannot_be_automated again - budget test: lower grandfathered ceilings to the trimmed lengths and cap total description text at 21,500 characters Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gaurav-singh-9227
approved these changes
Oct 30, 2026
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.
Summary
Shortens tool and parameter descriptions so the full tool list fits in clients that cap it. Kiro, for example, renders every tool description into a single 30,000-character activation result and truncates anything longer; once truncated, the agent guesses tool names.
latest/oldestthrough a Zod.transform()(src/lib/version-keyword.ts).askBrowserStackAIreports changes it could not confirm.Measurements
Guard
tests/tools/toolDescriptionBudget.test.tsnow:Testing
npm run build(lint, format, tests, tsc) passes.🤖 Generated with Claude Code