Preserve legacy capability report calls - #197
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
rgarcia
approved these changes
Sep 17, 2026
rgarcia
left a comment
Contributor
There was a problem hiding this comment.
reviewed — the compatibility paths are clear and the targeted tests pass. two things worth addressing:
Questions
src/lib/mcp/tools/missing-capability.ts:112-119— the refreshed schema also advertises every structured field as optional. a compliant current client can repeatedly send onlycontext, receivelegacy_schema_refresh_required, refresh to the same schema, and never record demand. could we preserve the required fields in the advertised current contract while accepting cached legacy calls at dispatch, or otherwise distinguish refreshed clients?
Test coverage
src/lib/mcp/analytics.test.ts:346-371— this test constructs the exact SDK error shape expected by the classifier, so it cannot catch changes in the real instrumentation path. consider sending an invalidget_more_toolscall through the existingsimulateRequestharness and asserting the captured$mcp_error_typeisvalidation.
Collaborator
Author
|
addressed both review points in 115f0fd:
validated with 606 tests, typecheck, formatting, and a production build. |
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
get_more_toolscalls from cached clients as a non-recording refresh responsetests
bun testbun x tsc --noEmitbun run buildNote
Low Risk
Behavior is narrowly scoped to exact legacy payloads and analytics labeling; structured reporting and demand capture paths are unchanged.
Overview
Adds backward compatibility for clients still calling
get_more_toolswith only acontextargument after the structured schema rollout. Those calls are intercepted at thetools/calllayer (before strict schema validation) and return a successfullegacy_schema_refresh_requiredpayload withrecorded: false, nudging a tools refresh instead of failing the agent. Partially structured payloads still validate against the full schema and error as before.get_more_toolsis registered viaregisterToolwith the structured Zod input unchanged. Analytics registration order is flipped so instrumentation wraps the legacy shim and still emits tool-call telemetry for compatibility responses. PostHog$mcp_tool_callevents for genuine schema rejections on this tool are reclassified from genericErrortovalidation.Docs and tests cover the legacy path, partial-input rejection, and validation telemetry.
Reviewed by Cursor Bugbot for commit bdca031. Bugbot is set up for automated code reviews on this repo. Configure here.