diff --git a/src/Everywhere.Core/Configuration/Settings/PluginSettings.cs b/src/Everywhere.Core/Configuration/Settings/PluginSettings.cs index 7ee600eb..24787076 100644 --- a/src/Everywhere.Core/Configuration/Settings/PluginSettings.cs +++ b/src/Everywhere.Core/Configuration/Settings/PluginSettings.cs @@ -1,4 +1,4 @@ -using System.Text.Json.Serialization; +using System.Text.Json.Serialization; using CommunityToolkit.Mvvm.ComponentModel; using Everywhere.Chat.Plugins; using Everywhere.Collections; @@ -76,6 +76,11 @@ public McpChatPluginEntity(McpChatPlugin mcpChatPlugin) return null; } + // Self-heal persisted Guid.Empty IDs; they cause KernelPluginCollection to throw + // a duplicate-key ArgumentException when two or more zero-ID plugins are loaded. + if (Id == Guid.Empty) + Id = Guid.CreateVersion7(); + return new McpChatPlugin(Id, transportConfiguration); } } \ No newline at end of file