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. No code changes detected at You can customize Macroscope's approvability policy. Learn more. |
xeophon
force-pushed
the
agent/fix-shared-docker-state-bridge
branch
from
July 27, 2026 13:25
8a1bb8e to
994b226
Compare
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
Changes rollout wiring for shared MCP state URLs across Docker/network modes; behavior is localized to launch/routing but mistakes could break per-rollout shared-state access.
Overview
Fixes per-rollout state-channel query params for taskset-scoped (shared) MCP servers that run in their own sandbox (e.g. Docker), where a host-local
state_basewas previously attached unchanged.SharedToolServernow keeps the liveRuntimeand usesruntime.is_localinstead of inferring locality from config.serve_sharedcreates one runtime per shared server and passes it intoservevia a new_runtimehook so startup/lifecycle stay aligned.In
serve_tools, the interceptionstate_baseis rewritten withserver.runtime.host_url(...)before tagging shared URLs, matching how per-rolloutservealready translates state for task-scoped servers. Tool MCP URLs are still translated through the harness runtime; external shared endpoints remain untagged.Reviewed by Cursor Bugbot for commit 994b226. 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 994b226.