From 9b5711d3124622b1f1b18500d442c76492da877a Mon Sep 17 00:00:00 2001
From: chunhualin1 <chunhualin1@lenovo.com>
Date: 星期一, 17 八月 2026 16:52:33 +0800
Subject: [PATCH] 优化llm插件及bug修复

---
 src/Moli.Desktop.Tests/WebView/PluginBridgeDispatcherTests.cs |   19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/src/Moli.Desktop.Tests/WebView/PluginBridgeDispatcherTests.cs b/src/Moli.Desktop.Tests/WebView/PluginBridgeDispatcherTests.cs
index b50c648..d012cfa 100644
--- a/src/Moli.Desktop.Tests/WebView/PluginBridgeDispatcherTests.cs
+++ b/src/Moli.Desktop.Tests/WebView/PluginBridgeDispatcherTests.cs
@@ -67,6 +67,8 @@
         var json = JsonSerializer.Serialize(response.Result, new JsonSerializerOptions(JsonSerializerDefaults.Web));
         Assert.Contains("gpt-test", json);
         Assert.DoesNotContain("endpoint", json, StringComparison.OrdinalIgnoreCase);
+        Assert.DoesNotContain("baseUrl", json, StringComparison.OrdinalIgnoreCase);
+        Assert.DoesNotContain("authRef", json, StringComparison.OrdinalIgnoreCase);
     }
 
     [Fact]
@@ -108,6 +110,7 @@
         Assert.True(response.Success);
         var json = JsonSerializer.Serialize(response.Result, new JsonSerializerOptions(JsonSerializerDefaults.Web));
         Assert.Contains("project-1", json);
+        Assert.Contains("ready", json);
     }
 
     [Fact]
@@ -214,6 +217,8 @@
     {
         public Task CancelAsync(string requestId, CancellationToken cancellationToken = default) => Task.CompletedTask;
 
+        public Task CancelPluginRequestsAsync(string pluginId, CancellationToken cancellationToken = default) => Task.CompletedTask;
+
         public Task<IReadOnlyList<LlmModelSummary>> GetModelsAsync(CancellationToken cancellationToken = default)
             => Task.FromResult<IReadOnlyList<LlmModelSummary>>(
             [
@@ -242,11 +247,15 @@
                     .ToList())
                 : GetModelsAsync(cancellationToken);
 
-        public Task<IReadOnlyList<AiChatProjectSummary>> GetProjectsAsync(LlmPluginRuntimeConfig runtimeConfig, CancellationToken cancellationToken = default)
-            => Task.FromResult<IReadOnlyList<AiChatProjectSummary>>(
-            [
-                new AiChatProjectSummary { Id = "project-1", Name = "Project 1" }
-            ]);
+        public Task<AiChatProjectsResult> GetProjectsAsync(LlmPluginRuntimeConfig runtimeConfig, CancellationToken cancellationToken = default)
+            => Task.FromResult(new AiChatProjectsResult
+            {
+                Status = AiChatProjectStatuses.Ready,
+                Projects =
+                [
+                    new AiChatProjectSummary { Id = "project-1", Name = "Project 1" }
+                ]
+            });
 
         public Task<AiChatMemoryCapabilities> GetMemoryCapabilitiesAsync(LlmPluginRuntimeConfig runtimeConfig, CancellationToken cancellationToken = default)
             => Task.FromResult(new AiChatMemoryCapabilities { CanUseMemory = true, CanViewMemory = true, CanManageMemory = true });

--
Gitblit v1.9.1