Skip to content

v2.22.2 — Port Resilience & Crash Detection

Choose a tag to compare

@francoios francoios released this 10 Mar 19:18

Multi-Project Port Resilience

This release adds a comprehensive 4-layer protection system for reliable multi-project workflows, fixing issues where the MCP server could lose track of the correct Unity Editor instance when multiple projects are open.

What's New

Port Identity Validation — When restoring a saved connection, the server now verifies the instance identity (project name + path) matches the expected target. If a different Unity project grabbed the same port after a restart, the server detects the mismatch and re-discovers the correct instance automatically.

Compile-Time Resilience — When a Unity Editor is unresponsive (e.g., during a long compile), the server checks the shared instance registry before dropping the connection. Fresh registry entries indicate the editor is still alive, preventing unnecessary disconnects.

Crash Detection — If Unity crashes mid-compile and OnDisable never fires, the registry entry goes stale (no heartbeat for >5 minutes). The server detects this and clears the stale entry, allowing proper re-discovery. Configurable via UNITY_REGISTRY_STALENESS_TIMEOUT.

Enhanced Discovery — Both registry fallback paths now check entry staleness, giving three-scenario coverage: normal shutdown, long compile, and crash.

Configuration

Variable Default Description
UNITY_REGISTRY_STALENESS_TIMEOUT 300000 (5 min) Time before a registry entry is considered stale
UNITY_RESPONSE_SOFT_LIMIT 2097152 (2 MB) Response size warning threshold
UNITY_RESPONSE_HARD_LIMIT 4194304 (4 MB) Response size truncation threshold

Requires

  • Plugin v2.21.1+ (for heartbeat and port affinity support)