-
Notifications
You must be signed in to change notification settings - Fork 2.9k
feat: support setting title and description for server #1793
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Add support for the `title` and `description` fields in the `Implementation` type, allowing servers to provide human-readable metadata during initialization. Changes: - Add `description` field to `types.Implementation` - Add `server_title` and `server_description` to `InitializationOptions` - Wire up title/description through `Server` constructor and session - Add test for title and description passthrough Github-Issue:#1783
| title: str | None = None, | ||
| description: str | None = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move to bottom to avoid positional kwarg errors
| ), | ||
| ) as server_session: | ||
| async for message in server_session.incoming_messages: # pragma: no branch | ||
| if isinstance(message, Exception): # pragma: no cover |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove pragma, instead just fail if there's an exception
|
|
||
| if isinstance(message, ClientNotification) and isinstance( | ||
| message.root, InitializedNotification | ||
| ): # pragma: no branch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove all pragmas if possible, use asserts with failures instead
| tg.start_soon(run_server) | ||
|
|
||
| result = await client_session.initialize() | ||
| except anyio.ClosedResourceError: # pragma: no cover |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove exception catching and either accept it through asserts or fail
Add support for the
titleanddescriptionfields in theImplementationtype, allowing servers to provide human-readable metadata during initialization.Changes:
descriptionfield totypes.Implementationserver_titleandserver_descriptiontoInitializationOptionsServerconstructor and sessionGithub-Issue:#1783
Motivation and Context
How Has This Been Tested?
Breaking Changes
Types of changes
Checklist
Additional context