Skip to content

Closing temporary forward-compatibility gap for a new MCP server event - #2124

Closed
almaleksia wants to merge 2 commits into
github:mainfrom
almaleksia:mcp-server-stopped-forward-compat
Closed

Closing temporary forward-compatibility gap for a new MCP server event #2124
almaleksia wants to merge 2 commits into
github:mainfrom
almaleksia:mcp-server-stopped-forward-compat

Conversation

@almaleksia

Copy link
Copy Markdown
Contributor

Before we add stopped MCP 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 change stopped events to not_configured (current behavior). This is a temporary change and will exist only between CLI and SDK corresponding updates.

Copilot AI review requested due to automatic review settings July 29, 2026 13:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds temporary forward compatibility for the new MCP stopped status in live session notifications.

Changes:

  • Remaps stopped to not_configured across 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

Comment thread nodejs/src/client.ts
* two MCP status events are inspected. Remove once `stopped` is added to the
* generated types.
*/
function normalizeStoppedMcpStatus(event: unknown): void {
Comment thread python/copilot/client.py
)


def _normalize_stopped_mcp_status(event: Any) -> None:
Comment thread rust/src/session.rs
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);
Comment thread go/client.go
if req.SessionID == "" {
return
}
normalizeStoppedMCPStatus(&req.Event)
Comment thread dotnet/src/Client.cs
var evt = SessionEvent.FromJson(@event.Value.GetRawText());
if (evt != null)
{
NormalizeStoppedMcpStatus(evt);
@almaleksia almaleksia closed this Jul 29, 2026
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