normalize string ID to int in server messages for compatibility (#851)

Co-authored-by: 晓明 王 <wxm@v1i.cc>
Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
This commit is contained in:
xiaoming wang 2025-06-08 15:15:21 +08:00 • committed by GitHub
commit 2cbc435c6c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -34,7 +34,7 @@ LATEST_PROTOCOL_VERSION = "2025-03-26"
ProgressToken = str | int
Cursor = str
Role = Literal["user", "assistant"]
RequestId = str | int
RequestId = Annotated[int | str, Field(union_mode="left_to_right")]
AnyFunction: TypeAlias = Callable[..., Any]
@ -353,7 +353,7 @@ class ProgressNotificationParams(NotificationParams):
"""Total number of items to process (or total progress required), if known."""
message: str | None = None
"""
Message related to progress. This should provide relevant human readable
Message related to progress. This should provide relevant human readable
progress information.
"""
model_config = ConfigDict(extra="allow")