Repository navigation
Restore Unity connections across managed frontends - #241
Merged
Merged
Conversation
Managed clients could not drive the host editor because reverse tunnels shadowed loopback traffic and connection settings diverged. Verify the serving HTTP instance before publishing the port, keep configuration sync asynchronous, preserve the optional token, and route managed frontends through the pinned bridge. Validation: full non-Unity gate passed (10 steps), strict pyright passed, eight subprocess bridge contracts and all sync/doctor contracts passed. The live doctor discovered 160 tools and drove the configured host project with zero failures or warnings. npm pack dry-run passed. No shipped C# changed. Host Unity 6000.5.2f1 on Windows: PlayMode 15/15 and AssetProcessorRelevanceTests 5/5 passed. Full EditMode twice passed 382/384; the same unrelated performance-driver contracts failed and are tracked in #240. Windows wildcard coexistence was observed in the prior host investigation; this session executes the subprocess regressions on Linux and leaves Windows execution to CI. Revert this commit to restore the previous connection behavior. Fixes #239. Refs #171, #114, #226, #240.
Windows terminates the bridge parent without stopping the fixture CLI child. The child keeps its current directory open, so temporary-directory cleanup fails even when the assertions pass. Stop the fixture process tree before removing its files; keep every behavior assertion. Validation: scoped fast check, strict pyright, and full non-Unity gate pass. Windows CI on PR #241 exposed this cleanup failure and will validate the repair. Refs #239.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b32384d. Configure here.
Equivalent Windows project pins and endpoint URLs could fail healthy bridge diagnostics. Normalize Windows dot segments and trailing separators before comparing case, and strip endpoint slashes before constructing the JS health URL. Regression tests fail before the repair for three Windows pin variants and the trailing-slash JS probe. All 13 doctor tests, strict pyright, the scoped fast check, and the full 39-file harness gate now pass. The live doctor confirms the correct host editor with zero failures or warnings. No Unity C# changed; the two separately recorded performance-driver failures remain on #240. Address both review findings on PR #241. Refs #239, #171.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

DISCLOSURE: LLM-GENERATED TEXT
Why: Managed frontends can fail to drive a running Unity host bridge.
What:
Fixes #239. Refs #171, #114, #226.
Note
Medium Risk
Changes shared MCP URLs, optional auth semantics, VS Code port-forward defaults, and host bridge startup/port selection—high impact on agent↔Unity connectivity but guarded by new contract tests.
Overview
Fixes managed agent frontends failing to reach a host-side Unity MCP HTTP bridge by aligning config, devcontainer networking, and diagnostics with container→host access (not VS Code reverse tunnels).
Devcontainer / VS Code: Disables automatic port forwarding, restoration, and forward-on-open so bridge ports are not shadowed by loopback tunnels; docs explain clearing stale forwards in the Ports view.
mcp:sync/configure.mjs: All managed frontends (including Cursor) now share the same pinnedhost.docker.internalbridge URL, with optionalUNITY_MCP_HTTP_URLand auth only whenUNITY_MCP_TOKENis already set (sync no longer auto-generates or rotates tokens). VS Code Unity entries get safermcp-remotequoting and valid command/args shape.Host bridge (
unity-mcp-host.mjs): Verifies the bound HTTP instance (instanceId/bridgePidon/healthz) before persisting port or syncing clients; keeps HTTP responsive during async config sync; tightens Windows port checks, env precedence (workspace over legacy~/.unity-mcpfor transport), and CLI crash/EPIPE recovery.Doctors: Unity checks honor
UNITY_MCP_HTTP_URL, always exercise MCPinitialize, and fail on health/RPC/editor canary problems (container mode targetshost.docker.internal; Windows path pins compare withntpath).Tests: New bridge integration suite plus expanded sync/doctor contracts.
Reviewed by Cursor Bugbot for commit 0cb1293. Bugbot is set up for automated code reviews on this repo. Configure here.