Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions Packages/OsaurusCore/Tests/Discord/DiscordConnectionTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,7 @@ struct DiscordConnectionTests {
}
}

@Test func nativeAgentChannelToolsAreDynamicButNotPluginOwned() async throws {
@Test func nativeAgentChannelToolsAreDisabledButRemainExternallyDenied() async throws {
let names = ToolRegistry.agentChannelToolNames.sorted()
let phantomDiscordNames: Set<String> = [
"discord_diagnostics",
Expand All @@ -891,10 +891,17 @@ struct DiscordConnectionTests {
phantomDiscordNames.filter { ToolRegistry.shared.entry(named: $0) != nil }
)
}
#expect(Set(names).isSubset(of: registeredNames))
// Agent Channel tool registration is intentionally disabled in
// `ToolRegistry.registerBuiltInTools`, so none of the native action
// tools are live in the registry. They must also never leak in as
// plugin-owned tools or collide with the phantom Discord vocabulary.
#expect(Set(names).isDisjoint(with: registeredNames))
#expect(pluginNames.isEmpty)
#expect(phantomNames.isEmpty)

// Even while the tools are disabled, their names stay on the
// external-surface deny list (defense in depth) and must never be
// promoted to built-ins.
for name in names {
#expect(ToolRegistry.externallyDeniedToolNames.contains(name))
#expect(!builtInNames.contains(name))
Expand Down
6 changes: 3 additions & 3 deletions Packages/OsaurusCore/Tools/ToolRegistry.swift
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,9 @@ final class ToolRegistry: ObservableObject {
ToolConfigurationStore.save(configuration)
}

for tool in Self.agentChannelTools {
registerNativeDynamicTool(tool)
}
// for tool in Self.agentChannelTools {
// registerNativeDynamicTool(tool)
// }
}

private static let agentChannelTools: [OsaurusTool] = [
Expand Down
Loading