Repository navigation
Conversation
SEP-3371: reject extensions defining core methods, install an extension whole or not at all, let extensions contribute notification handlers (server, BC break on ServerExtensionInterface) and request/notification handlers (client), let an extension require others, checked on build, and expose sending custom requests and notifications on both sides.
soyuka
requested review from
CodeWithKyrian,
Nyholm and
chr-hertel
as code owners
November 26, 2026 16:34
8 tasks
This branch has not been 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.
Registration and custom methods from SEP-3371, on server and client. Middleware needs a design first, it'll come in its own PR.
MessageFactory::isCoreMethod(): an extension can't define a core method anymore (tools/call,initialize, ...), "core" being the methods the SDK knows (message registry,server/discover,subscriptions/listenand its ack) so there is no second list to keep in sync.enableExtension(): an extension is validated before anything is stored, so a rejected one leaves nothing installed. This is per extension, inenableExtension($a, $b)a rejected$bdoesn't remove$a.DependentExtensionInterface::getRequiredExtensions(): checked on build so the order ofenableExtension()calls doesn't matter, a missing one throwsExtension "X" requires extension "Y", which is not enabled.ClientExtensionInterface: request and notification handlers for the client. Handler types differ per side, so an extension with methods on both sides ships one class per side sharing the schema messages, which also fits the package split.Client\Builder::enableExtension(): the client now decodes extension messages, before they were dropped with "Failed to parse message".Client::sendRequest()is public (same signature as [Server] Add the Tasks extension (SEP-2663), experimental #776) andClient::notify()is new.ClientGateway::request()is no longer@internal. The gateway is built per handler call from that call's session and keeps nothing else, so it's safe in worker mode.docs/advanced/extensions.mdlists the extension points and the SEP number per role, as the SEP asks.[BC Break]
ServerExtensionInterface::getNotificationHandlers(): the SEP wants extensions to bring notification handlers too, I'd rather have one interface per side than a second optional one, and we're pre-1.0 so the deprecation policy allows it. Implementers return[], #776 will need it when rebasing.Not in this PR, and known limits:
addRequestHandler()) targeting an extension method: handlers pick their messages at runtime throughsupports()and the SEP allows replacing what a method does.ClientGateway::request()returns the rawResponseorError, and throws without a session or on 2026-07-28 where server to client requests don't exist.