Commit d4f63f8
authored
go-sdk review: schema bypass canary test, ServerInfo logging, doc comments (#3531)
Addresses high-priority items from the go-sdk module review (#748): SDK
upgrade safety canary, backend diagnostics, and documentation for
maintainers.
### Schema bypass canary test
- `TestSchemaBypassCanary` registers tools with draft-07 features
(`$ref`, `definitions`, `patternProperties`) via `Server.AddTool` and
asserts no panic. Breaks loudly if a future SDK version tightens
validation on the instance method path that
`registerToolWithoutValidation` relies on.
### Surface backend server info during registration
- New `Connection.ServerInfo()` extracts name/version from
`session.InitializeResult()`.
- `registerToolsFromBackend` logs backend identity on connect, or notes
its absence — useful for debugging version mismatches.
```go
if name, version := conn.ServerInfo(); name != "" {
logger.LogInfoWithServer(serverID, "backend", "Backend server info: name=%s, version=%s", name, version)
}
```
### Documentation for future maintainers
- **`marshalToResponse` ID placeholder**: explains why `ID: 1` is safe
(SDK resolves correlation internally; this ID is never used for
matching).
- **Local `CallToolParams` type**: explains why `mcp/types.go` maintains
its own type with `map[string]interface{}` Arguments instead of reusing
the SDK's `json.RawMessage`-based params.
> [!WARNING]
>
> <details>
> <summary>Firewall rules blocked me from connecting to one or more
addresses (expand for details)</summary>
>
> #### I tried to connect to the following addresses, but was blocked by
firewall rules:
>
> - `example.com`
> - Triggering command: `/tmp/go-build2372329102/b510/launcher.test
/tmp/go-build2372329102/b510/launcher.test
-test.testlogfile=/tmp/go-build2372329102/b510/testlog.txt
-test.paniconexit0 -test.timeout=10m0s -test.v=true g_.a
ache/go/1.25.8/x-ifaceassert u/13/cc1 -I ernal/logger -I u/13/cc1 ache��
SaYeuEbQ8 64/src/net 64/pkg/tool/linu-nilfunc -p crypto/internal/-o
-lang=go1.25 64/pkg/tool/linu-trimpath` (dns block)
> - Triggering command: `/tmp/go-build3813880827/b514/launcher.test
/tmp/go-build3813880827/b514/launcher.test
-test.testlogfile=/tmp/go-build3813880827/b514/testlog.txt
-test.paniconexit0 -test.timeout=10m0s -ato�� -bool -buildtags
x_amd64/vet -errorsas -ifaceassert -nilfunc x_amd64/vet -ato�� -bool
-buildtags x_amd64/vet -errorsas -ifaceassert -nilfunc x_amd64/vet` (dns
block)
> - `invalid-host-that-does-not-exist-12345.com`
> - Triggering command: `/tmp/go-build2372329102/b492/config.test
/tmp/go-build2372329102/b492/config.test
-test.testlogfile=/tmp/go-build2372329102/b492/testlog.txt
-test.paniconexit0 -test.timeout=10m0s -test.v=true ternal/ieee754/i-p
_cgo_.o x_amd64/compile` (dns block)
> - Triggering command: `/tmp/go-build3813880827/b496/config.test
/tmp/go-build3813880827/b496/config.test
-test.testlogfile=/tmp/go-build3813880827/b496/testlog.txt
-test.paniconexit0 -test.timeout=10m0s -o
/tmp/go-build2372329102/b390/_pkg_.a -trimpath .test -p
google.golang.or/tmp/go-build3275255162/b301/vet.cfg -lang=go1.24 .test
3723�� /tmp/go-build2372329102/b422/_pkg_.a -trimpath de/node/bin/git -p
google.golang.or/tmp/go-build3275255162/b430/vet.cfg -lang=go1.24
/opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linu/tmp/go-build2372329102/b537/_testmain.go`
(dns block)
> - `nonexistent.local`
> - Triggering command: `/tmp/go-build2372329102/b510/launcher.test
/tmp/go-build2372329102/b510/launcher.test
-test.testlogfile=/tmp/go-build2372329102/b510/testlog.txt
-test.paniconexit0 -test.timeout=10m0s -test.v=true g_.a
ache/go/1.25.8/x-ifaceassert u/13/cc1 -I ernal/logger -I u/13/cc1 ache��
SaYeuEbQ8 64/src/net 64/pkg/tool/linu-nilfunc -p crypto/internal/-o
-lang=go1.25 64/pkg/tool/linu-trimpath` (dns block)
> - Triggering command: `/tmp/go-build3813880827/b514/launcher.test
/tmp/go-build3813880827/b514/launcher.test
-test.testlogfile=/tmp/go-build3813880827/b514/testlog.txt
-test.paniconexit0 -test.timeout=10m0s -ato�� -bool -buildtags
x_amd64/vet -errorsas -ifaceassert -nilfunc x_amd64/vet -ato�� -bool
-buildtags x_amd64/vet -errorsas -ifaceassert -nilfunc x_amd64/vet` (dns
block)
> - `slow.example.com`
> - Triggering command: `/tmp/go-build2372329102/b510/launcher.test
/tmp/go-build2372329102/b510/launcher.test
-test.testlogfile=/tmp/go-build2372329102/b510/testlog.txt
-test.paniconexit0 -test.timeout=10m0s -test.v=true g_.a
ache/go/1.25.8/x-ifaceassert u/13/cc1 -I ernal/logger -I u/13/cc1 ache��
SaYeuEbQ8 64/src/net 64/pkg/tool/linu-nilfunc -p crypto/internal/-o
-lang=go1.25 64/pkg/tool/linu-trimpath` (dns block)
> - Triggering command: `/tmp/go-build3813880827/b514/launcher.test
/tmp/go-build3813880827/b514/launcher.test
-test.testlogfile=/tmp/go-build3813880827/b514/testlog.txt
-test.paniconexit0 -test.timeout=10m0s -ato�� -bool -buildtags
x_amd64/vet -errorsas -ifaceassert -nilfunc x_amd64/vet -ato�� -bool
-buildtags x_amd64/vet -errorsas -ifaceassert -nilfunc x_amd64/vet` (dns
block)
> - `this-host-does-not-exist-12345.com`
> - Triggering command: `/tmp/go-build2372329102/b519/mcp.test
/tmp/go-build2372329102/b519/mcp.test
-test.testlogfile=/tmp/go-build2372329102/b519/testlog.txt
-test.paniconexit0 -test.timeout=10m0s -test.v=true
s/known/wrapperspb/wrappers.pb.go .cfg x_amd64/compile --gdwarf-5 --64
-o x_amd64/compile -o g_.a 2329102/b165/ x_amd64/vet -p` (dns block)
> - Triggering command: `/tmp/go-build3813880827/b523/mcp.test
/tmp/go-build3813880827/b523/mcp.test
-test.testlogfile=/tmp/go-build3813880827/b523/testlog.txt
-test.paniconexit0 -test.timeout=10m0s -ato�� 2329102/b519/mcp-errorsas
-buildtags x_amd64/vet -errorsas -ifaceassert -nilfunc x_amd64/vet
n-me�� ry=1 {{json .Mounts}} ache/Python/3.12.13/x64/bin/sh
ache/go/1.25.8/xbash .cfg ache/go/1.25.8/x--version
/usr/bin/runc.original` (dns block)
>
> If you need me to access, download, or install something from one of
these locations, you can either:
>
> - Configure [Actions setup
steps](https://gh.io/copilot/actions-setup-steps) to set up my
environment, which run before the firewall is enabled
> - Add the appropriate URLs or hosts to the custom allowlist in this
repository's [Copilot coding agent
settings](https://github.com/github/gh-aw-mcpg/settings/copilot/coding_agent)
(admins only)
>
> </details>File tree
4 files changed
+107
-2
lines changed- internal
- mcp
- server
4 files changed
+107
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
287 | 287 | | |
288 | 288 | | |
289 | 289 | | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
290 | 304 | | |
291 | 305 | | |
292 | 306 | | |
| |||
482 | 496 | | |
483 | 497 | | |
484 | 498 | | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
485 | 504 | | |
486 | 505 | | |
487 | 506 | | |
| |||
490 | 509 | | |
491 | 510 | | |
492 | 511 | | |
493 | | - | |
| 512 | + | |
494 | 513 | | |
495 | 514 | | |
496 | 515 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
38 | 45 | | |
39 | 46 | | |
40 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
156 | 164 | | |
157 | 165 | | |
158 | 166 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
591 | 592 | | |
592 | 593 | | |
593 | 594 | | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
0 commit comments