mcp: use args struct for CloseSSEStream (#718)

Change CloseSSEStream from func(time.Duration) to
func(CloseSSEStreamArgs) for forward compatibility, allowing new fields
to be added without breaking existing callers.
This commit is contained in:
Robert Findley 2025-12-11 15:13:38 -05:00 • committed by GitHub
commit b3399e6730
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -503,8 +503,8 @@ func jsonSchema202012Handler(ctx context.Context, req *mcp.CallToolRequest, inpu
func testReconnectionHandler(ctx context.Context, req *mcp.CallToolRequest, _ any) (*mcp.CallToolResult, any, error) {
// Close the SSE stream to trigger client reconnection (SEP-1699)
if req.Extra != nil && req.Extra.CloseStream != nil {
req.Extra.CloseStream(10 * time.Millisecond)
if req.Extra != nil && req.Extra.CloseSSEStream != nil {
req.Extra.CloseSSEStream(mcp.CloseSSEStreamArgs{RetryAfter: 10 * time.Millisecond})
}
// Wait for client to reconnect