Skip to content

Upgrade go-sdk to v1.6.0 and consolidate session-missing detection#6017

Merged
lpcox merged 4 commits into
mainfrom
copilot/go-fan-review-sdk-module
May 19, 2026
Merged

Upgrade go-sdk to v1.6.0 and consolidate session-missing detection#6017
lpcox merged 4 commits into
mainfrom
copilot/go-fan-review-sdk-module

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 19, 2026

This module is the core MCP dependency in gh-aw-mcpg, and the repo was one minor version behind on modelcontextprotocol/go-sdk. This PR updates the SDK and tightens a small MCP transport code path called out in the review by removing duplicated session-not-found string matching.

  • Dependency refresh

    • Bumps github.com/modelcontextprotocol/go-sdk from v1.5.0 to v1.6.0.
    • Updates transitive module metadata/checksums (including github.com/google/jsonschema-go).
  • Session-not-found detection cleanup

    • Introduces a shared constant for the backend session-missing message in internal/mcp/http_transport.go.
    • Reuses that constant in both helpers:
      • isSessionNotFoundError
      • isSessionNotFoundHTTPResponse
    • Keeps behavior unchanged while removing duplicated literals.
  • SDK contract annotation update

    • Updates the bypass-validation contract note in internal/server/tool_registry.go to reflect verification against go-sdk v1.6.0.
const (
    HTTPTransportPlainJSON HTTPTransportType = "plain-json"
    sessionNotFoundMessage                   = "session not found"
)

func isSessionNotFoundError(err error) bool {
    if errors.Is(err, sdk.ErrSessionMissing) {
        return true
    }
    return strings.Contains(strings.ToLower(err.Error()), sessionNotFoundMessage)
}

Copilot AI linked an issue May 19, 2026 that may be closed by this pull request
5 tasks
Copilot AI changed the title [WIP] Review Go SDK for Model Context Protocol Upgrade go-sdk to v1.6.0 and consolidate session-missing detection May 19, 2026
Copilot finished work on behalf of lpcox May 19, 2026 15:34
Copilot AI requested a review from lpcox May 19, 2026 15:34
@lpcox lpcox marked this pull request as ready for review May 19, 2026 21:24
Copilot AI review requested due to automatic review settings May 19, 2026 21:24
@lpcox
Copy link
Copy Markdown
Collaborator

lpcox commented May 19, 2026

@copilot fix the failing linting ci check

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the repository’s core MCP dependency (modelcontextprotocol/go-sdk) to v1.6.0 and slightly refactors the HTTP transport session-missing detection to remove duplicated string literals, while also updating one SDK-contract annotation.

Changes:

  • Bump github.com/modelcontextprotocol/go-sdk from v1.5.0 to v1.6.0 (and refresh transitive sums, incl. github.com/google/jsonschema-go).
  • Consolidate "session not found" matching into a shared constant in internal/mcp/http_transport.go.
  • Update the bypass-validation SDK behavior note in internal/server/tool_registry.go to reference v1.6.0 verification.
Show a summary per file
File Description
internal/server/tool_registry.go Updates the SDK-contract verification comment to v1.6.0.
internal/mcp/http_transport.go Introduces sessionNotFoundMessage constant and reuses it in both session-missing detectors.
go.mod Upgrades go-sdk to v1.6.0 and bumps jsonschema-go indirect dependency.
go.sum Refreshes checksums for upgraded direct/transitive modules.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 3/4 changed files
  • Comments generated: 1

Comment on lines 32 to 36
HTTPTransportSSE HTTPTransportType = "sse"
// HTTPTransportPlainJSON uses plain JSON-RPC 2.0 over HTTP POST (non-standard)
HTTPTransportPlainJSON HTTPTransportType = "plain-json"
sessionNotFoundMessage = "session not found"
)
@lpcox
Copy link
Copy Markdown
Collaborator

lpcox commented May 19, 2026

@copilot address the review feedback

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 19, 2026

@copilot fix the failing linting ci check

Fixed in the latest commit. The staticcheck rule SA9004 flagged mixing typed (HTTPTransportType) and untyped constants in the same const block. I moved sessionNotFoundMessage into its own separate const declaration to resolve it.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 19, 2026

@copilot address the review feedback

Done. Updated all three stale v1.5.0 annotation occurrences to v1.6.0 in http_transport.go, connection.go, and http_transport_test.go.

Copilot finished work on behalf of lpcox May 19, 2026 21:32
@lpcox lpcox merged commit dad5178 into main May 19, 2026
7 checks passed
@lpcox lpcox deleted the copilot/go-fan-review-sdk-module branch May 19, 2026 21:34
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.

[go-fan] Go Module Review: modelcontextprotocol/go-sdk

3 participants