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
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_base was previously attached unchanged.

SharedToolServer now keeps the live Runtime and uses runtime.is_local instead of inferring locality from config. serve_shared creates one runtime per shared server and passes it into serve via a new _runtime hook so startup/lifecycle stay aligned.

In serve_tools, the interception state_base is rewritten with server.runtime.host_url(...) before tagging shared URLs, matching how per-rollout serve already 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

  • 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 994b226.

@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.

No code changes detected at 994b226. Prior analysis still applies.

You can customize Macroscope's approvability policy. Learn more.

@xeophon
xeophon requested a review from mikasenghaas July 24, 2026 11:56
@xeophon
xeophon force-pushed the agent/fix-shared-docker-state-bridge branch from 8a1bb8e to 994b226 Compare July 27, 2026 13:25
@xeophon
xeophon requested a review from hallerite July 27, 2026 13:27
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