Repository navigation
fix: keep the last duplicate tool in a registration batch - #477
Merged
punkpeye merged 1 commit intoOct 27, 2026
Merged
Conversation
|
🎉 This PR is included in version 4.23.8 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
When
addTools()receives multiple definitions with the same name,tools/listadvertises all of them whiletools/callexecutes only the last. Clients can therefore see an obsolete input or output schema for the tool they actually call.Keep the last definition of each name, in the same order as sequential
addTool()calls. Check every tool's Standard Schema interfaces before changing registrations and retain one list-change notification per batch.Regression coverage uses an SDK client over
InMemoryTransport. It checks duplicate names before and after connection, replacement of an existing tool, the advertised schemas and actual calls, unaffected tools, notification counts, and atomic rejection of unsupported Standard Schema interfaces on inputs and outputs. Both duplicate-name cases fail on the unmodified implementation.Validation on macOS with Node 24 and pnpm 9:
pnpm test: 81 files, 1,262 tests passed.pnpm lint: passed, including the JSR publish dry-run.pnpm build: passed.pnpm test:openapi: both files and all 15 benchmark/live tests passed.Prepared with AI assistance (OpenAI Codex).