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
Make domain reload detection more deterministic (reduce 20s timeout) #657
Currently, when Unity performs a domain reload (e.g., after running tests or compiling scripts), the MCP connection drops. The server waits up to 20 seconds for Unity to reconnect before failing commands.
This 20-second timeout handles most domain reloads, but it could cause unnecessary delays in agentic workflows where domain reloads happen frequently.
Current Behavior
UNITY_MCP_SESSION_RESOLVE_MAX_WAIT_S defaults to 20 seconds
UNITY_MCP_RELOAD_MAX_WAIT_S defaults to 20 seconds
Server blindly waits up to 20s when no Unity session is available
Proposed Improvement
Make detection more deterministic by:
Detecting Unity's actual reload state rather than blindly waiting
Check the status file for "reloading" state
Monitor for connection attempts during the wait period
Use exponential backoff with early exit when connection is established
Shorter default with smart detection
Default to ~5-10 seconds for normal operations
Extend only when domain reload is detected (via status file or heuristics)
changed the title [-]Make domain reload detection more deterministic (reduce 30s timeout)[/-][+]Make domain reload detection more deterministic (reduce 20s timeout)[/+]on Jan 31, 2026
Activity
[-]Make domain reload detection more deterministic (reduce 30s timeout)[/-][+]Make domain reload detection more deterministic (reduce 20s timeout)[/+]dsarno commentedon Feb 13, 2026
Think maybe don't need this after all.
feat: deterministic domain reload detection (CoplayDev#657)