Skip to content

Commit a1c00ed

Browse files
committed
Polish config cleanup and status errors
1 parent d6ff2bd commit a1c00ed

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

MCPForUnity/Editor/Helpers/ConfigJsonBuilder.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,6 @@ private static void PopulateUnityNode(JObject unity, string uvPath, McpClient cl
101101
// Remove url/serverUrl if they exist from previous config
102102
if (unity["url"] != null) unity.Remove("url");
103103
if (unity["serverUrl"] != null) unity.Remove("serverUrl");
104-
foreach (var prop in urlPropsToRemove)
105-
{
106-
if (unity[prop] != null) unity.Remove(prop);
107-
}
108104

109105
if (isVSCode)
110106
{

MCPForUnity/Editor/Windows/Components/ClientConfig/McpClientConfigSection.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,15 +348,27 @@ private void RefreshClaudeCliStatus(IMcpClientConfigurator client, bool forceImm
348348
MCPServiceLocator.Client.CheckClientStatus(client, attemptAutoRewrite: false);
349349
}).ContinueWith(t =>
350350
{
351+
bool faulted = false;
352+
string errorMessage = null;
351353
if (t.IsFaulted && t.Exception != null)
352354
{
353-
McpLog.Error($"Failed to refresh Claude CLI status: {t.Exception.GetBaseException().Message}");
355+
var baseException = t.Exception.GetBaseException();
356+
errorMessage = baseException?.Message ?? "Status check failed";
357+
McpLog.Error($"Failed to refresh Claude CLI status: {errorMessage}");
358+
faulted = true;
354359
}
355360

356361
EditorApplication.delayCall += () =>
357362
{
358363
statusRefreshInFlight.Remove(client);
359364
lastStatusChecks[client] = DateTime.UtcNow;
365+
if (faulted)
366+
{
367+
if (client is McpClientConfiguratorBase baseConfigurator)
368+
{
369+
baseConfigurator.Client.SetStatus(McpStatus.Error, errorMessage ?? "Status check failed");
370+
}
371+
}
360372
ApplyStatusToUi(client);
361373
};
362374
});

0 commit comments

Comments
 (0)