You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: add recovery guidance when no Unity session is available (#1265) - #1470
When the HTTP server was running but no Unity session could be found, the response contained only retry information and no verification steps. Adds guidance to the no_unity_session response that tells users to launch Unity, start an MCP session, and bring the window to the foreground to check for dialogs.
Type of Change
Bug fix (non-breaking change that fixes an issue)
New feature (non-breaking change that adds functionality)
Breaking change (fix or feature that would cause existing functionality to change)
Documentation update
Refactoring (no functional changes)
Test update
Changes Made
Adds human-readable recovery steps to the no_unity_session response in PluginHub. Explains that the server is responding and the requested Unity session is unavailable.
Preserves the existing error, hint: retry, data.reason, and retry_after_ms: 250. Places the guidance in the existing message field and leaves the stale_connection response unchanged.
Adds steps to the troubleshooting guide: confirm that reloading has completed, start a session, bring Unity from the background to the foreground, and recheck instance registration.
Compatibility / Package Source
Unity version(s) tested: Not applicable (changes to the Python server and documentation).
Package source used (#beta, #main, tag, branch, or file:): Source branched from 142ea0a on beta.
Resolved commit hash from Packages/packages-lock.json (if using a Git package URL): Not applicable.
Testing/Screenshots/Recordings
Python tests (cd Server && uv run pytest tests/ -v): 1,575 passed, 18 skipped.
Unity EditMode tests
Unity PlayMode tests
Package import/compile check
Not applicable (explain why in Additional Notes)
Started an isolated localhost HTTP server and used the real FastMCP SDK to initialize it, read mcpforunity://instances, and call 2 tools. The server was healthy, with 0 Unity registrations, and before the fix, both read_console and refresh_unity(wait_for_ready=false) returned message: null.
After the fix, received recovery guidance from both tools and verified that the existing error and retry information was unchanged. Also verified that the endpoint stopped responding after the verification server was shut down. Verification used an empty registration state without mocking requests to Unity or session resolution.
The generated-docs consistency check and site build succeeded. Also ran the prescribed multi-version Unity check, but all 4 specified versions were skipped because they were not installed.
Also ran the same coverage-enabled test run as CI, locally on Python 3.10.20, with 1,575 passed and 18 skipped. tools/tests had 205 passed, and the generated-docs check and tool count comparison also succeeded.
Documentation Updates
I have added/removed/modified tools or resources
If yes, I have updated all documentation files using:
The LLM prompt at tools/UPDATE_DOCS_PROMPT.md (recommended)
Manual review of the generated changes
There are no changes to tool definitions, arguments, or counts. Adds the guidance to the troubleshooting documentation.
Addresses the request for diagnostic guidance in #1265. Session loss while Unity is in the background and stalled compilation remain open issues. Since the changes affect only the Python server and documentation, Unity EditMode, PlayMode, and package compile verification are not applicable.
Fork CI verification
Checked the GitHub Actions results for the same commit 9fcf0416c77b854afe6c4ab0c291f5f3a79923f5. The Python tests succeeded, as did the harness tests that run without Unity.
The upstream GitHub Actions are waiting for a maintainer to approve the run for the current commit. The CI successes above are results from runs on the fork that verified the same commit.
Summary by CodeRabbit
Bug Fixes
Responses caused by an unavailable Unity session now include an actionable message. Other retry responses remain unchanged.
Documentation
Added troubleshooting guidance for unavailable Unity sessions, including checks for editor reloads, session startup, pending dialogs, and instance registration.
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Advanced
Run ID: 86277d5d-f9ac-4f4f-bfc8-db2397a1335e
📥 Commits
Reviewing files that changed from the base of the PR and between 142ea0a and 9fcf041.
📒 Files selected for processing (2)
Server/src/transport/plugin_hub.py
website/docs/guides/troubleshooting.md
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
📝 Walkthrough
The unavailable-session retry response now includes a user-facing message for no_unity_session. The troubleshooting guide explains the response and lists checks for Unity session availability.
Changes: Unity Session Retry Guidance
Layer / File(s)
Summary
Retry message and troubleshooting guidance Server/src/transport/plugin_hub.py, website/docs/guides/troubleshooting.md
For no_unity_session, the retry response now includes a message directing users to start Unity or address pending dialogs. The guide describes the response and lists checks for Unity state and editor registration.
No material merge-blocking risk remains; the recovery guidance is available on the HTTP MCP response path it changes.
Pre-merge checks · 4 · 1
Failed checks (1 warning)
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. (1 skipped: 1 …
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks (4 passed)
Check name
Status
Explanation
Description check
The description follows the repository template. It includes the change summary, change type, detailed changes, compatibility information, testing results, documentation notes, related issue, and addi…
Title check
The title clearly and concisely describes the primary change: adding recovery guidance when no Unity session is available.
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. (1 skipped: 1 unsupported.)
Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.
This branch has not been deployed
No deployments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When the HTTP server was running but no Unity session could be found, the response contained only retry information and no verification steps. Adds guidance to the
no_unity_sessionresponse that tells users to launch Unity, start an MCP session, and bring the window to the foreground to check for dialogs.Type of Change
Changes Made
no_unity_sessionresponse inPluginHub. Explains that the server is responding and the requested Unity session is unavailable.error,hint: retry,data.reason, andretry_after_ms: 250. Places the guidance in the existingmessagefield and leaves thestale_connectionresponse unchanged.Compatibility / Package Source
#beta,#main, tag, branch, orfile:): Source branched from 142ea0a onbeta.Packages/packages-lock.json(if using a Git package URL): Not applicable.Testing/Screenshots/Recordings
cd Server && uv run pytest tests/ -v): 1,575 passed, 18 skipped.Started an isolated localhost HTTP server and used the real FastMCP SDK to initialize it, read
mcpforunity://instances, and call 2 tools. The server was healthy, with 0 Unity registrations, and before the fix, bothread_consoleandrefresh_unity(wait_for_ready=false)returnedmessage: null.After the fix, received recovery guidance from both tools and verified that the existing error and retry information was unchanged. Also verified that the endpoint stopped responding after the verification server was shut down. Verification used an empty registration state without mocking requests to Unity or session resolution.
The generated-docs consistency check and site build succeeded. Also ran the prescribed multi-version Unity check, but all 4 specified versions were skipped because they were not installed.
Also ran the same coverage-enabled test run as CI, locally on Python 3.10.20, with 1,575 passed and 18 skipped.
tools/testshad 205 passed, and the generated-docs check and tool count comparison also succeeded.Documentation Updates
tools/UPDATE_DOCS_PROMPT.md(recommended)There are no changes to tool definitions, arguments, or counts. Adds the guidance to the troubleshooting documentation.
Related Issues
Relates to #1265
Additional Notes
Addresses the request for diagnostic guidance in #1265. Session loss while Unity is in the background and stalled compilation remain open issues. Since the changes affect only the Python server and documentation, Unity EditMode, PlayMode, and package compile verification are not applicable.
Fork CI verification
Checked the GitHub Actions results for the same commit
9fcf0416c77b854afe6c4ab0c291f5f3a79923f5. The Python tests succeeded, as did the harness tests that run without Unity.The docs build succeeded.
The upstream GitHub Actions are waiting for a maintainer to approve the run for the current commit. The CI successes above are results from runs on the fork that verified the same commit.
Summary by CodeRabbit
Bug Fixes
Documentation