-
Notifications
You must be signed in to change notification settings - Fork 650
Add automatic uv installation and improve dependency setup flow #584
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -94,12 +94,40 @@ public override string GetInstallationRecommendations() | |
| - Direct download: https://python.org/downloads/windows/ | ||
|
|
||
| 2. uv Package Manager: Install via PowerShell | ||
| - Run: powershell -ExecutionPolicy ByPass -c ""irm https://astral.sh/uv/install.ps1 | iex"" | ||
| - Run: powershell -NoProfile -ExecutionPolicy ByPass -c ""irm https://astral.sh/uv/install.ps1 | iex"" | ||
| - Or download from: https://github.com/astral-sh/uv/releases | ||
|
|
||
| 3. MCP Server: Will be installed automatically by MCP for Unity Bridge"; | ||
| } | ||
|
|
||
| public override bool InstallUv() | ||
| { | ||
| try | ||
| { | ||
| McpLog.Info("Attempting to install uv package manager via PowerShell..."); | ||
|
|
||
| var psi = new System.Diagnostics.ProcessStartInfo | ||
| { | ||
| FileName = "powershell.exe", | ||
| Arguments = "-NoProfile -ExecutionPolicy ByPass -Command \"irm https://astral.sh/uv/install.ps1 | iex\"", | ||
|
Comment on lines
+103
to
+112
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue (bug_risk): Handle long-running installs and potential timeout behavior more robustly.
Please check the return value of |
||
| UseShellExecute = false, | ||
| CreateNoWindow = false // Show window so user sees progress | ||
| }; | ||
|
|
||
| using var process = System.Diagnostics.Process.Start(psi); | ||
| if (process == null) return false; | ||
|
|
||
| process.WaitForExit(60000); // Wait up to 1 minute | ||
|
|
||
| return process.ExitCode == 0; | ||
| } | ||
| catch (Exception ex) | ||
| { | ||
| McpLog.Error($"Failed to install uv: {ex.Message}"); | ||
| return false; | ||
| } | ||
| } | ||
|
|
||
| public override DependencyStatus DetectUv() | ||
| { | ||
| // First, honor overrides and cross-platform resolution via the base implementation | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -55,7 +55,7 @@ public string GetUvxPath() | |
| } | ||
|
|
||
| // Fallback to bare command | ||
| return "uvx"; | ||
| return null; | ||
| } | ||
|
|
||
| /// <summary> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,6 +7,7 @@ | |
| using System.Security.Cryptography; | ||
| using System.Text; | ||
| using MCPForUnity.Editor.Constants; | ||
| using MCPForUnity.Editor.Dependencies; | ||
| using MCPForUnity.Editor.Helpers; | ||
| using UnityEditor; | ||
| using UnityEngine; | ||
|
|
@@ -410,6 +411,47 @@ public bool StartLocalHttpServer() | |
| /// Clean stale Python build artifacts when using a local dev server path | ||
| AssetPathUtility.CleanLocalServerBuildArtifacts(); | ||
|
|
||
| // Check if uv is installed, and offer to install if missing. | ||
| var detector = DependencyManager.GetCurrentPlatformDetector(); | ||
| var uvStatus = detector.DetectUv(); | ||
| if (!uvStatus.IsAvailable) | ||
| { | ||
| if (EditorUtility.DisplayDialog( | ||
| "uv Package Manager Missing", | ||
| "The 'uv' package manager is required to run the local MCP server, but it was not found in your PATH.\n\n" + | ||
| "Would you like to attempt an automatic installation now?", | ||
| "Install uv", | ||
| "Cancel")) | ||
|
Comment on lines
+415
to
+424
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion (performance): Avoid blocking server startup on a potentially long-running interactive installer without clear feedback.
Consider:
Suggested implementation: // Check if uv is installed, and offer to install if missing.
var detector = DependencyManager.GetCurrentPlatformDetector();
var uvStatus = detector.DetectUv();
if (!uvStatus.IsAvailable)
{
if (EditorUtility.DisplayDialog(
"uv Package Manager Missing",
"The 'uv' package manager is required to run the local MCP server, but it was not found in your PATH.\n\n" +
"An automatic installation can be attempted now. This may take up to 60 seconds while a local HTTP server is started.\n\n" +
"Alternatively, you can start the server without uv (if you plan to install it manually or are just inspecting the project).",
"Install uv (may take up to 60 seconds)",
"Start without uv"))
{
EditorUtility.DisplayProgressBar(
"Installing uv",
"Installing the 'uv' package manager. This may take up to 60 seconds...",
0.5f);
try
{
if (detector.InstallUv())
{
// Re-check after installation
}
}
finally
{
EditorUtility.ClearProgressBar();
}The current control flow already effectively separates the “install uv” and “start without uv” paths: declining the dialog skips
|
||
| { | ||
| if (detector.InstallUv()) | ||
| { | ||
| // Re-check after installation | ||
| uvStatus = detector.DetectUv(); | ||
| if (!uvStatus.IsAvailable) | ||
| { | ||
| EditorUtility.DisplayDialog( | ||
| "Installation Incomplete", | ||
| "uv was installed, but it is not yet detected in the current process PATH. " + | ||
| "You may need to restart Unity for the changes to take effect.", | ||
| "OK"); | ||
| return false; | ||
| } | ||
| } | ||
| else | ||
| { | ||
| EditorUtility.DisplayDialog( | ||
| "Installation Failed", | ||
| "Failed to automatically install uv. Please install it manually:\n\n" + detector.GetUvInstallUrl(), | ||
| "OK"); | ||
| return false; | ||
| } | ||
| } | ||
| else | ||
| { | ||
| return false; | ||
| } | ||
| } | ||
|
Comment on lines
+414
to
+453
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Blocking main thread during uv installation may freeze Unity Editor. The Consider running the installation asynchronously or showing a progress dialog to inform the user that the operation is in progress. 💡 Suggested approachOption 1: Add a simple progress indicator before blocking: EditorUtility.DisplayProgressBar("Installing uv", "Please wait while uv is being installed...", 0.5f);
try
{
if (detector.InstallUv())
{
// ...
}
}
finally
{
EditorUtility.ClearProgressBar();
}Option 2 (better UX): Refactor 🤖 Prompt for AI Agents |
||
|
|
||
| if (!TryGetLocalHttpServerCommandParts(out _, out _, out var displayCommand, out var error)) | ||
| { | ||
| EditorUtility.DisplayDialog( | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -25,6 +25,7 @@ public class MCPSetupWindow : EditorWindow | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private Label installationInstructions; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private Button openPythonLinkButton; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private Button openUvLinkButton; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private Button autoInstallUvButton; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private Button refreshButton; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private Button doneButton; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -68,6 +69,7 @@ public void CreateGUI() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| installationInstructions = rootVisualElement.Q<Label>("installation-instructions"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| openPythonLinkButton = rootVisualElement.Q<Button>("open-python-link-button"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| openUvLinkButton = rootVisualElement.Q<Button>("open-uv-link-button"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| autoInstallUvButton = rootVisualElement.Q<Button>("auto-install-uv-button"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| refreshButton = rootVisualElement.Q<Button>("refresh-button"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| doneButton = rootVisualElement.Q<Button>("done-button"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -76,6 +78,7 @@ public void CreateGUI() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| doneButton.clicked += OnDoneClicked; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| openPythonLinkButton.clicked += OnOpenPythonInstallClicked; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| openUvLinkButton.clicked += OnOpenUvInstallClicked; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| autoInstallUvButton.clicked += OnAutoInstallUvClicked; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Initial update | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| UpdateUI(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -113,6 +116,40 @@ private void OnOpenUvInstallClicked() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Application.OpenURL(uvUrl); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private void OnAutoInstallUvClicked() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| var detector = DependencyManager.GetCurrentPlatformDetector(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (detector.InstallUv()) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| _dependencyResult = DependencyManager.CheckAllDependencies(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| UpdateUI(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| var uvDep = _dependencyResult.Dependencies.Find(d => d.Name == "uv Package Manager"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (uvDep != null && !uvDep.IsAvailable) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| EditorUtility.DisplayDialog( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "Installation Incomplete", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "uv was installed, but it is not yet detected in the current process PATH. " + | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "You may need to restart Unity for the changes to take effect.", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "OK"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| EditorUtility.DisplayDialog( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "Installation Successful", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "uv package manager has been installed successfully.", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "OK"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| EditorUtility.DisplayDialog( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "Installation Failed", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "Failed to automatically install uv. Please install it manually.", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "OK"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+119
to
+151
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same blocking concern applies here. This handler has the same main-thread blocking issue mentioned in Consider adding a progress bar here as well to provide feedback during the installation: 💡 Suggested fix private void OnAutoInstallUvClicked()
{
var detector = DependencyManager.GetCurrentPlatformDetector();
+ EditorUtility.DisplayProgressBar("Installing uv", "Please wait while uv is being installed...", 0.5f);
+ bool installResult;
+ try
+ {
+ installResult = detector.InstallUv();
+ }
+ finally
+ {
+ EditorUtility.ClearProgressBar();
+ }
+
- if (detector.InstallUv())
+ if (installResult)
{
_dependencyResult = DependencyManager.CheckAllDependencies();
UpdateUI();
// ... rest of the logic📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private void UpdateUI() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (_dependencyResult == null) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: CoplayDev/unity-mcp
Length of output: 831
🏁 Script executed:
Repository: CoplayDev/unity-mcp
Length of output: 1748
🏁 Script executed:
Repository: CoplayDev/unity-mcp
Length of output: 749
🏁 Script executed:
Repository: CoplayDev/unity-mcp
Length of output: 1284
🏁 Script executed:
Repository: CoplayDev/unity-mcp
Length of output: 1814
🏁 Script executed:
Repository: CoplayDev/unity-mcp
Length of output: 313
🏁 Script executed:
Repository: CoplayDev/unity-mcp
Length of output: 1181
🏁 Script executed:
Repository: CoplayDev/unity-mcp
Length of output: 45
🏁 Script executed:
Repository: CoplayDev/unity-mcp
Length of output: 855
🏁 Script executed:
Repository: CoplayDev/unity-mcp
Length of output: 232
Avoid blocking the editor and handle installer timeouts.
Both call sites (
MCPSetupWindow.cs:122andServerManagementService.cs:426) executeInstallUv()on the main editor thread. The current implementation blocks for up to 60 seconds withWaitForExit(60000), freezing the UI.Additionally, the code ignores the timeout result; if
WaitForExittimes out and returnsfalse, accessingprocess.ExitCodethrowsInvalidOperationException, leaving the installer process running in the background. While caught by the outer try-catch, this silently returnsfalsewithout cleaning up the orphaned process.🔧 Safer timeout handling (still synchronous)
Consider moving this operation to a background thread or async pattern to prevent UI hangs during installation.
📝 Committable suggestion
🤖 Prompt for AI Agents