stacklok / stacklok/toolhive

Modern dispatch answers ping, which 2026-07-28 removed, and omits the required resultType

Open
#6,064 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

needs-triage
Dominant language
Go
Stars
2.2k
Forks
300
Avg merge
1d 15h
Merged PRs (30d)
184

Description

Summary

Two small conformance problems on the same line of dispatchModern, both pre-existing and currently inert.

1. ping was removed in 2026-07-28. grep -ci ping against schema/draft/schema.ts returns 0 (it returns 7 against schema/2025-11-25/schema.ts, where PingRequest { method: "ping" } is defined). go-sdk agrees — mcp/server.go:1880 lists methodPing among methods "removed in the new protocol" and answers -32601. Per SEP-2575's own rule for an unsupported RPC, -32601 (HTTP 404) is the conformant answer, which means the default: branch of the dispatch switch was already correct and the explicit ping case should not be there.

2. The result omits resultType, which is a MUST. writeModernResult(w, id, struct{}{}) emits a bare {}. schema/draft/schema.ts:229 states "Servers implementing this protocol version MUST include this field" for resultType, on every result. So even if ping were still a valid Modern method, this response would be non-conformant.

A comment at pkg/vmcp/server/modern_dispatch.go:110-111 asserts that a bare {} is "the correct, spec-matching result" — wrong on both counts, and its cited authority is unreachable for a Modern request. That comment has been corrected in #6050; the behaviour was deliberately left alone there to avoid scope creep on a pre-existing path with existing tests.

Impact: currently none

A Modern go-sdk client never pings — startKeepalive sits past an early return at client.go:357. So nothing reaches this path today, which is why it was left rather than fixed mid-review.

It matters if a non-go-sdk Modern client ever pings, or if someone reads this path as a template for another method's result shape. The second is the likelier harm: resultType is required on every Modern result, and a copy of this code would inherit the omission.

Suggested fix

Delete the ping case so it falls to default: and returns -32601, matching both the spec and the reference implementation. Check whether any existing test asserts the current {}/200 behaviour and update it — a test pinning a non-conformant response is worth removing regardless.

While there, audit other writeModernResult call sites for the same resultType omission.

Refs #6050, #5959.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in pkg/vmcp/server/modern_dispatch.go at dispatchModern and inspect existing tests for the current ping response. Verify how the default branch handles unsupported methods, then review writeModernResult call sites for the required resultType and update any affected tests. Done means unsupported ping requests return -32601 and Modern results include resultType where required.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, typescript
Domain
api, backend-api-design
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.