Fix shared Docker state bridge routing#2123
Open
xeophon wants to merge 1 commit into
Open
Conversation
ApprovabilityVerdict: Needs human review This PR changes Docker networking behavior by translating state channel URLs through each shared server's runtime. The PR author labels it 'Medium Risk' noting that incorrect translation would break per-rollout state communication for shared tools. You can customize Macroscope's approvability policy. Learn more. |
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.
Overview
Fix per-rollout state-channel routing for taskset-scoped tool servers by retaining the runtime that actually hosts each shared server.
Details
The state bridge URL is now translated through the shared server runtime's existing
host_url()behavior. This reuses Docker's platform-aware networking rules: macOS containers usehost.docker.internal, Linux host-network containers keep loopback, and restricted containers use the framework host alias.Tool endpoint translation remains owned by the harness runtime. External server URLs remain untagged, so per-rollout state secrets are not attached to third-party endpoints.
Note
Medium Risk
Touches rollout wiring for shared MCP servers and Docker networking for the state channel; scope is limited to
launch.pybut mis-translation would break per-rollout task/state for shared tools.Overview
Fixes per-rollout state-channel URLs for taskset-scoped (shared) MCP tool servers when those servers run in their own runtime (e.g. Docker), where a host-local
state_basewas previously attached unchanged.serve_sharednow keeps the liveRuntimeonSharedToolServer, injects it intoservevia optional_runtime(so locality usesruntime.is_localinstead of config-onlyruntime_is_local), andserve_toolsrewritesstate_basewithserver.runtime.host_url()before tagging shared URLs—matching how per-rolloutservealready buildsVF_STATE_URL.Tool reachability for the harness is unchanged; external shared endpoints stay untagged. Drops the unused
runtime_is_localimport fromlaunch.py.Reviewed by Cursor Bugbot for commit 8a1bb8e. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fix shared Docker state bridge routing by translating state base URLs through each shared server's runtime
Runtimeinstance inSharedToolServer, making it available for URL translation.serve_tools, the shared-state base URL is now translated throughserver.runtime.host_url(...)when a runtime is present, so the harness passes a reachable state channel address for that server's network context.serveaccepts an optional_runtimeparameter to avoid redundant runtime creation when one is already available.Macroscope summarized 8a1bb8e.