Skip to content

armgit / cua

Public Imported from GitHub
0

Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.

fix(spaces-sdk-swift): count the person-only thread tools in the contract tests (CUA-3399) (#6493)

injaneityc7e57f8638a6
diff --git a/libs/spaces-sdk-swift/Tests/CuaSpacesTests/CuaBackedTests.swift b/libs/spaces-sdk-swift/Tests/CuaSpacesTests/CuaBackedTests.swift
index 738af46175..cb66822504 100644
--- a/libs/spaces-sdk-swift/Tests/CuaSpacesTests/CuaBackedTests.swift
+++ b/libs/spaces-sdk-swift/Tests/CuaSpacesTests/CuaBackedTests.swift
@@ -228,9 +228,10 @@ struct Fixtures {
spacesHome: work.appendingPathComponent("cua").path,
teleportHome: fx.fields["teleport_host_home"])
let tools = try await connection.availableTools()
- // `cloud_approve` is person-only: it is in the contract but never
- // served as a tool.
- XCTAssertEqual(Set(tools), Set(SpacesConnection.contractTools).subtracting(["cloud_approve"]))
+ // Person-only tools (`PERSON_ONLY_TOOLS`) are in the contract but
+ // never served as tools.
+ let personOnly: Set<String> = ["cloud_approve", "agent_threads", "agent_thread_read"]
+ XCTAssertEqual(Set(tools), Set(SpacesConnection.contractTools).subtracting(personOnly))
try await exercise(connection, fx, work: work, keyvault: false)
}
diff --git a/libs/spaces-sdk-swift/Tests/CuaSpacesTests/ToolCoverageTests.swift b/libs/spaces-sdk-swift/Tests/CuaSpacesTests/ToolCoverageTests.swift
index e638909f55..392f7a23a5 100644
--- a/libs/spaces-sdk-swift/Tests/CuaSpacesTests/ToolCoverageTests.swift
+++ b/libs/spaces-sdk-swift/Tests/CuaSpacesTests/ToolCoverageTests.swift
@@ -38,10 +38,12 @@ import Testing
"thread_join_code_cancel", "thread_join_code_create", "thread_join_code_list",
"thread_join_redeem", "thread_post", "thread_read", "thread_reply",
"thread_settings",
+ // Person-only, and the contract's SDK symbol for both is `callTool`.
+ "agent_threads", "agent_thread_read",
]
@Test func testTheContractIsCompleteTools() {
- XCTAssertEqual(Self.advertisedTools.count, 119)
+ XCTAssertEqual(Self.advertisedTools.count, 121)
// The Python server's `local_rcdp` is gone; `stream_endpoint` mints a
// media ticket for any provider, and `send_file` is new.
XCTAssertFalse(Self.advertisedTools.contains("local_rcdp"))