LATEST_PROTOCOL_VERSION misdescribes what the shim requests, and Initialize silently discards the caller's version
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 48/100
Hướng nghiên cứu
Bắt đầu với mcpcompat/mcp/jsonrpc.go và client.Initialize, sau đó kiểm tra ba vị trí gọi trong mã production tại pkg/transport/bridge.go, pkg/vmcp/client/client.go và pkg/vmcp/session/internal/backend/mcp_session.go. Xem lại TestListCapabilities_MisCachedLegacy_SelfHealsViaSDKNegotiation và giới hạn go-sdk được liên kết trước khi quyết định cách ghi tài liệu cho LATEST_PROTOCOL_VERSION. Được xem là hoàn tất khi hành vi của Initialize và ngữ nghĩa của hằng số được nêu rõ, với phần validation được bao phủ mà không thay đổi hành vi negotiation hiện tại.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Rescoped. This issue originally bundled two conformance findings that turned out to be upstream-only; those are now go-sdk#1112 and go-sdk#1113. See the correction comment for why neither was fixable here. What remains below is shim-side.
The defect
mcpcompat exports a constant that no longer describes what the shim does:
// mcpcompat/mcp/jsonrpc.go:15
const LATEST_PROTOCOL_VERSION = "2025-11-25"
Meanwhile go-sdk's latestProtocolVersion is 2026-07-28, and client.Initialize calls Connect(ctx, tr, nil) — so the shim always requests 2026-07-28 on the wire, whatever the caller asked for. request.Params.ProtocolVersion is read nowhere in Initialize.
The combination is what makes this worth fixing: a consumer reads LATEST_PROTOCOL_VERSION, reasonably concludes the shim speaks 2025-11-25, passes it to Initialize, and gets 2026-07-28 requested — silently.
That is not hypothetical. Every ToolHive production initialize does exactly this:
pkg/transport/bridge.go:197pkg/vmcp/client/client.go:852pkg/vmcp/session/internal/backend/mcp_session.go:553
Important: do not "fix" this by honouring the request
The substitution is load-bearing for ToolHive today. Because the wire request is 2026-07-28, a Modern-capable backend answers initialize with 2026-07-28, which is precisely how ToolHive's legacyInit detects a mis-cached backend and flips its revision cache Legacy→Modern (stacklok/toolhive#5997, pinned by TestListCapabilities_MisCachedLegacy_SelfHealsViaSDKNegotiation).
Honouring a requested 2025-11-25 would make that backend negotiate 2025-11-25, the self-heal would never fire, and vMCP's Legacy→Modern correction would silently regress. Rejecting an unhonourable request would break all three production call sites immediately, since they all pass a version that cannot be honoured.
Honouring is also not currently possible: ClientSessionOptions.protocolVersion is unexported upstream (go-sdk#1113).
Proposed work — documentation and validation only, no behaviour change
- Document
client.Initialize: state plainly thatParams.ProtocolVersiondoes not influence the wire version, that go-sdk requests its own latest and negotiates down, and link go-sdk#1113. This removes the silence, which is the actual harm. - Fix or document
LATEST_PROTOCOL_VERSION. Two options, and this is the decision worth discussing:- Document it as an mcp-go compatibility constant that reflects neither the revision the shim requests nor the newest it supports. Zero risk.
- Change it to
2026-07-28. Behaviourally a no-op forInitialize(the value is discarded anyway), but it is exported and consumers may compare against it, so it needs a consumer sweep first.toolhiveuses it in at least the three production sites above plus several tests.
- Validate genuinely invalid input: a requested version that go-sdk does not recognise at all is unambiguously a caller bug and can return an error, with no effect on any current caller.
Non-goal
Making the shim honour arbitrary requested versions. That is blocked on go-sdk#1113 and, per the above, would need a coordinated change in toolhive because the current behaviour is depended upon.
Generated with Claude Code
- Ngôn ngữ chính
- Go
- Star
- 2
- Fork
- 6
- Merge trung bình
- 23 giờ 44 phút
- Pull request đã merge (30 ngày)
- 133
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của stacklok/toolhive-core
-
needs-triage
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 54/100
stacklok/toolhive-core#466 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
needs-triage
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 66/100
stacklok/toolhive-core#426 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
mcpcompat/server: refuse dispatch of a request whose per-request context is goneCó thể đã có người làm @jhrozek đã nhận 15 ngày trước. Đang mởneeds-triage
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 54/100
stacklok/toolhive-core#414 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
needs-triage
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 8/100
stacklok/toolhive-core#343 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
needs-triage
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 12/100
stacklok/toolhive-core#342 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của stacklok/toolhive-core
Issue tương tự
-
GitHub webhook is not subscribed to release events, so `event: release` never triggersCó thể đã có người làm @qsun đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
woodpecker-ci/woodpecker#7542 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
zilliztech/milvus-backup#1386 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Pipelined flush no longer observes kill signals after #2042: flush backoffer is built with nil varsĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
model:sonnet runtime:claude security size:S
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
FootprintAI/Containarium#3624 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 1 ngày