Closing temporary forward-compatibility gap for a new MCP server event - #2124
Closed
almaleksia wants to merge 2 commits into
Closed
Closing temporary forward-compatibility gap for a new MCP server event #2124almaleksia wants to merge 2 commits into
almaleksia wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds temporary forward compatibility for the new MCP stopped status in live session notifications.
Changes:
- Remaps
stoppedtonot_configuredacross six SDKs. - Adds parse-and-retry handling for strict Python and Java enums.
- Limits normalization to MCP status events.
Show a summary per file
| File | Description |
|---|---|
rust/src/session.rs |
Normalizes raw MCP notification payloads. |
python/copilot/client.py |
Normalizes and retries strict event parsing. |
nodejs/src/client.ts |
Rewrites MCP statuses before dispatch. |
java/src/main/java/com/github/copilot/RpcHandlerDispatcher.java |
Retries deserialization after normalization. |
go/client.go |
Rewrites typed MCP event data. |
dotnet/src/Client.cs |
Rewrites typed MCP statuses before dispatch. |
Review details
- Files reviewed: 6/6 changed files
- Comments generated: 6
- Review effort level: Medium
| * two MCP status events are inspected. Remove once `stopped` is added to the | ||
| * generated types. | ||
| */ | ||
| function normalizeStoppedMcpStatus(event: unknown): void { |
| ) | ||
|
|
||
|
|
||
| def _normalize_stopped_mcp_status(event: Any) -> None: |
| notification.event.event_type.as_str(), | ||
| "session.mcp_servers_loaded" | "session.mcp_server_status_changed" | ||
| ) { | ||
| normalize_stopped_mcp_status(&mut notification.event); |
Comment on lines
+113
to
+114
| normalizeStoppedMcpStatus(eventNode); | ||
| event = MAPPER.treeToValue(eventNode, SessionEvent.class); |
| if req.SessionID == "" { | ||
| return | ||
| } | ||
| normalizeStoppedMCPStatus(&req.Event) |
| var evt = SessionEvent.FromJson(@event.Value.GetRawText()); | ||
| if (evt != null) | ||
| { | ||
| NormalizeStoppedMcpStatus(evt); |
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.
Before we add
stoppedMCP server status to SDK we need to make sure that clients do not regress getting session events with the new status from the API. This PR adds normalization of session events that changestoppedevents tonot_configured(current behavior). This is a temporary change and will exist only between CLI and SDK corresponding updates.