Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 31, 2026

  • Examine all public types in Protocol namespace that are not sealed
  • Fix JsonRpcMessageContext - seal the class (has implicit public constructor)
  • Fix RequestSchema (nested in ElicitRequestParams) - seal the class (has implicit public constructor)
  • Fix LegacyTitledEnumSchema (nested in ElicitRequestParams) - seal the class
  • Delete EnumSchema type and update all references to use LegacyTitledEnumSchema instead
  • Fix Converter class in PrimitiveSchemaDefinition - seal the class
  • Fix Converter class in ResourceContents - seal the class
  • Fix Converter class in ContentBlock - seal the class
  • Build and run tests to verify changes
  • Run code review
  • Run CodeQL security scan

Summary

This PR ensures that all public reference types in the Protocol namespace are either sealed or have only internal/private/private protected constructors, preventing external inheritance.

The abstract base classes (JsonRpcMessage, JsonRpcMessageWithId, RequestParams, PaginatedRequestParams, Result, PaginatedResult, NotificationParams, ContentBlock, ResourceContents, Reference, PrimitiveSchemaDefinition, TransportBase) already had private protected constructors.

The following public classes were sealed:

  • JsonRpcMessageContext
  • ElicitRequestParams.RequestSchema
  • ElicitRequestParams.LegacyTitledEnumSchema
  • ContentBlock.Converter
  • ResourceContents.Converter
  • ElicitRequestParams.PrimitiveSchemaDefinition.Converter

Note: The EnumSchema type was deleted and all references updated to use LegacyTitledEnumSchema instead.

Original prompt

Examine every public type in Protocol to ensure that none are externally inheritable, e.g. every reference type should either be sealed or have only internal / private / private protected constructors.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
Copilot AI changed the title [WIP] Examine public types in Protocol for inheritable issues Seal public Protocol reference types to prevent external inheritance Jan 31, 2026
Copilot AI requested a review from stephentoub January 31, 2026 04:23
…chema

Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
@stephentoub stephentoub marked this pull request as ready for review January 31, 2026 04:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants