feat: 2025-11-25 review fixes (#201)
* fix: review fixes of the latest changes * fix: updated unit tests * chore: more conformance compliance improvements * chore: reverted protocol changes * chore: more compliance improvements * chore: more conformance compliance improvements * chore: improvements to the backcompat and updated to Tool unit tests * chore: ci update
This commit is contained in:
parent
6112a3995a
commit
973b46b8f7
1 changed files with 692 additions and 507 deletions
|
|
@ -183,23 +183,6 @@ struct SamplingTests {
|
|||
#expect(request.params.maxTokens == 100)
|
||||
}
|
||||
|
||||
@Test("Server capabilities include sampling")
|
||||
func testServerCapabilitiesIncludeSampling() throws {
|
||||
let capabilities = Server.Capabilities(
|
||||
sampling: .init()
|
||||
)
|
||||
|
||||
#expect(capabilities.sampling != nil)
|
||||
|
||||
let encoder = JSONEncoder()
|
||||
let decoder = JSONDecoder()
|
||||
|
||||
let data = try encoder.encode(capabilities)
|
||||
let decoded = try decoder.decode(Server.Capabilities.self, from: data)
|
||||
|
||||
#expect(decoded.sampling != nil)
|
||||
}
|
||||
|
||||
@Test("Client capabilities include sampling")
|
||||
func testClientCapabilitiesIncludeSampling() throws {
|
||||
let capabilities = Client.Capabilities(
|
||||
|
|
@ -507,8 +490,7 @@ struct SamplingIntegrationTests {
|
|||
|
||||
let server = Server(
|
||||
name: "SamplingHandlerTestServer",
|
||||
version: "1.0",
|
||||
capabilities: .init(sampling: .init())
|
||||
version: "1.0"
|
||||
)
|
||||
|
||||
let client = Client(
|
||||
|
|
@ -553,8 +535,7 @@ struct SamplingIntegrationTests {
|
|||
|
||||
let server = Server(
|
||||
name: "SamplingRequestTestServer",
|
||||
version: "1.0",
|
||||
capabilities: .init(sampling: .init())
|
||||
version: "1.0"
|
||||
)
|
||||
|
||||
let client = Client(
|
||||
|
|
@ -721,8 +702,7 @@ struct SamplingIntegrationTests {
|
|||
|
||||
let server = Server(
|
||||
name: "ErrorTestServer",
|
||||
version: "1.0",
|
||||
capabilities: .init(sampling: .init())
|
||||
version: "1.0"
|
||||
)
|
||||
|
||||
// Client WITHOUT sampling capability
|
||||
|
|
@ -757,7 +737,6 @@ struct SamplingIntegrationTests {
|
|||
let server = Server(
|
||||
name: "StrictTestServer",
|
||||
version: "1.0",
|
||||
capabilities: .init(sampling: .init()),
|
||||
configuration: .strict
|
||||
)
|
||||
|
||||
|
|
@ -806,7 +785,6 @@ struct SamplingIntegrationTests {
|
|||
let server = Server(
|
||||
name: "StrictTestServer",
|
||||
version: "1.0",
|
||||
capabilities: .init(sampling: .init()),
|
||||
configuration: .strict
|
||||
)
|
||||
|
||||
|
|
@ -840,7 +818,6 @@ struct SamplingIntegrationTests {
|
|||
let server = Server(
|
||||
name: "NonStrictTestServer",
|
||||
version: "1.0",
|
||||
capabilities: .init(sampling: .init()),
|
||||
configuration: .default // Non-strict mode
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue