Skip to content

Fix shared Docker state bridge routing#2123

Open
xeophon wants to merge 1 commit into
mainfrom
agent/fix-shared-docker-state-bridge
Open

Fix shared Docker state bridge routing#2123
xeophon wants to merge 1 commit into
mainfrom
agent/fix-shared-docker-state-bridge

Conversation

@xeophon

@xeophon xeophon commented Jul 24, 2026

Copy link
Copy Markdown
Member

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 use host.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.py but 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_base was previously attached unchanged.

serve_shared now keeps the live Runtime on SharedToolServer, injects it into serve via optional _runtime (so locality uses runtime.is_local instead of config-only runtime_is_local), and serve_tools rewrites state_base with server.runtime.host_url() before tagging shared URLs—matching how per-rollout serve already builds VF_STATE_URL.

Tool reachability for the harness is unchanged; external shared endpoints stay untagged. Drops the unused runtime_is_local import from launch.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

  • Shared servers now store their Runtime instance in SharedToolServer, making it available for URL translation.
  • In serve_tools, the shared-state base URL is now translated through server.runtime.host_url(...) when a runtime is present, so the harness passes a reachable state channel address for that server's network context.
  • serve accepts an optional _runtime parameter to avoid redundant runtime creation when one is already available.
  • Behavioral Change: tagged URLs passed to the harness for shared servers now reflect the server's Docker network address rather than the host-local state base.

Macroscope summarized 8a1bb8e.

@macroscopeapp

macroscopeapp Bot commented Jul 24, 2026

Copy link
Copy Markdown

Approvability

Verdict: 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.

@xeophon
xeophon requested a review from mikasenghaas July 24, 2026 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant