mcp/server: advertise completions only if installed (#213)
Previously, completions would always be advertised as a capability even if the CompletionHandler was not installed by the server. This CL fixes that.
This commit is contained in:
parent
0cde9623d3
commit
faaf77dc05
1 changed files with 38 additions and 36 deletions
|
|
@ -314,9 +314,8 @@ func TestStreamableServerTransport(t *testing.T) {
|
|||
initReq := req(1, methodInitialize, &InitializeParams{})
|
||||
initResp := resp(1, &InitializeResult{
|
||||
Capabilities: &serverCapabilities{
|
||||
Completions: &completionCapabilities{},
|
||||
Logging: &loggingCapabilities{},
|
||||
Tools: &toolCapabilities{ListChanged: true},
|
||||
Logging: &loggingCapabilities{},
|
||||
Tools: &toolCapabilities{ListChanged: true},
|
||||
},
|
||||
ProtocolVersion: latestProtocolVersion,
|
||||
ServerInfo: &Implementation{Name: "testServer", Version: "v1.0.0"},
|
||||
|
|
@ -732,9 +731,8 @@ func TestStreamableClientTransportApplicationJSON(t *testing.T) {
|
|||
}
|
||||
initResult := &InitializeResult{
|
||||
Capabilities: &serverCapabilities{
|
||||
Completions: &completionCapabilities{},
|
||||
Logging: &loggingCapabilities{},
|
||||
Tools: &toolCapabilities{ListChanged: true},
|
||||
Logging: &loggingCapabilities{},
|
||||
Tools: &toolCapabilities{ListChanged: true},
|
||||
},
|
||||
ProtocolVersion: latestProtocolVersion,
|
||||
ServerInfo: &Implementation{Name: "testServer", Version: "v1.0.0"},
|
||||
|
|
|
|||
Loading…
Reference in a new issue