Added a way to switch off tools you never need (#1115)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2026-10-27 08:48:52 +01:00
1 parent dcba62b45c
commit 04546c25ac
31 files changed
+638 -37

No files matched your search

@@ -540,6 +540,24 @@ public sealed class ConfigurationSnippetImportTests : ToolRegistryTestBase
});
}
[Test]
public async Task AToolYouSwitchedOffIsNotMissing()
{
var registry = this.CreateRegistry(new TestTool(Definition()));
registry.SetSwitchedOffByUser(TOOL_ID, true);
var policy = await ConfigurationSnippetImport.ResolveReferencesAsync(Import(ExportPolicy(allowedToolIds: [TOOL_ID]), PluginConfigurationObjectType.DOCUMENT_ANALYSIS_POLICY), this.SettingsManager, registry);
var template = await ConfigurationSnippetImport.ResolveReferencesAsync(Import(ExportChatTemplate([], [TOOL_ID]), PluginConfigurationObjectType.CHAT_TEMPLATE), this.SettingsManager, registry);
Assert.Multiple(() =>
{
Assert.That(policy.Hints, Is.Empty, "The tool exists on this computer; switching it on again makes the policy use it.");
Assert.That(template.Hints, Is.Empty);
Assert.That(((DataDocumentAnalysisPolicy)policy.ConfigurationObject).AllowedToolIds, Is.EquivalentTo(new[] { TOOL_ID }), "The import keeps the tool.");
Assert.That(((ChatTemplate)template.ConfigurationObject).ToolIds, Is.EquivalentTo(new[] { TOOL_ID }));
});
}
[Test]
public async Task AChatTemplateWhichSaysNothingAboutToolsKeepsSayingNothing()
{