Repository navigation
Add a Python Unity HTTP bridge - #299
Merged
Eli Pinkerton (wallstop) merged 3 commits intoOct 19, 2026
Merged
Eli Pinkerton (wallstop) merged 3 commits into
Eli Pinkerton (wallstop) merged 3 commits into
Conversation
The Unity HTTP host is the last substantive Node implementation in the tooling migration. Add a direct Python bridge while keeping the existing entry active for a bounded cutover. Keep lazy CLI ownership, ID remapping, authentication, batch and notification semantics, timeout and crash recovery, early-body draining, dynamic port publication, Docker route identity checks, and responsive config sync. Share real HTTP contracts with the old implementation and cover Python route failures separately. Strict pyright and actual Python 3.9 contracts pass. The final 17-step gate passes the full harness suite. An isolated native Windows startup verifies the Docker route; container initialization, 160-tool discovery, and editor status reach the pinned Unity project. The validation process tree was stopped and its temporary workspace deleted. C# remains at the previously validated 395 EditMode and 15 PlayMode passes. Refs #171. A later bounded layer switches the existing host entry point.
Eli Pinkerton (wallstop)
added this pull request to stack #297
October 18, 2026 20:57
Windows virtual-environment python.exe redirects to a separate interpreter process. The fixtures compared the redirector PID with the bridge PID. Use the base interpreter for both fixture processes so process identity assertions keep checking the actual server. All three failing cases pass in a fresh native Windows venv. Strict pyright, the affected fast check, and the complete 17-step gate pass. The repair changes tests only. Refs #171.
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 1fd531f. Configure here.
A failed spawn could remove the previous request's pending entry before the new request acquired an ID. Remove only the ID acquired by the failing request. Add a regression that keeps the earlier waiter reachable until CLI failure completes it. Windows SO_REUSEADDR can bind beside an active listener. Use default Windows binding for both probes and the HTTP server; retain Unix TIME_WAIT reuse. libuv uses the same Windows policy because SO_EXCLUSIVEADDRUSE also rejects TIME_WAIT sockets: https://github.com/libuv/libuv/blob/v1.x/src/win/tcp.c Both regressions fail before repair. Native Windows passes all seven startup unit cases, including the occupied reusable listener; all 14 shared Python host cases complete with four expected platform/legacy skips. Strict pyright and the final 17-step gate pass. Refs #171 and PR #299 review findings.
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: The Unity HTTP bridge still depends on a Node implementation.
What:
Refs #171.
Type of Change
Checklist
Note
Medium Risk
New network-facing bridge code paths (auth, port binding, Docker route checks, CLI process management) parallel the Node host; behavior is heavily tested but mistakes could break MCP connectivity or port publication.
Overview
Adds a typed Python Unity MCP HTTP bridge (
scripts/unity_mcp_host.py) as a Node-free host option, runnable viauv run scripts/unity_mcp_host.py, using the sameunity_mcp_settingsresolution,/healthzidentity, bearer auth, JSON-RPC over/mcp, Unity CLI subprocess lifecycle, and startup flow (local self-check, Dockerhost.docker.internalinstance verification, dynamic port selection,.env.localpublication, optionalmcp_configure.pysync).Tests extend the shared
HostTestsharness withPythonHostTests(Python fake CLI, config-sync fixture) plus focused unit tests for Docker-route failures, publication guards, spawn/timeout/batch/parse behavior, and Windows port probing. Docs note the Python bridge alongside the legacy Node host.Reviewed by Cursor Bugbot for commit 094f3a7. Bugbot is set up for automated code reviews on this repo. Configure here.