feat(runtime): resolve sandbox ports over a shared Docker network#775
Merged
Conversation
…etwork Add STRIX_DOCKER_SANDBOX_NETWORK: when set, sandbox containers join that user-defined network and exposed ports resolve to the container's address on it, instead of a host-published 127.0.0.1 port. This lets the orchestrator run as a sibling container (e.g. Compose / DinD) rather than on the Docker host. Unset preserves the existing host-loopback behavior.
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Contributor
Greptile SummaryThis PR lets containerized orchestrators reach Docker sandboxes over a shared network. The main changes are:
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (2): Last reviewed commit: "fix(runtime): resolve IPv6-only sandbox ..." | Re-trigger Greptile |
Contributor
Author
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.
Summary
Lets the Docker runtime work when the orchestrator itself runs inside a container (Compose, DinD, etc.) rather than on the Docker host.
Today the SDK publishes each sandbox's exposed ports to the host loopback and resolves them at
127.0.0.1:<host-port>. That only works if the orchestrator process shares the host's network namespace. When the orchestrator is a sibling container,127.0.0.1is its own loopback, so it can't reach the sandbox's Caido proxy and bootstrap fails.New opt-in env
STRIX_DOCKER_SANDBOX_NETWORK:127.0.0.1.Two small pieces in
strix/runtime/docker_client.py:The SDK chooses the session class inside its own
create()with no injection hook, soStrixDockerSandboxClient.create()callssuper().create()and then swaps the resolver onto the returned session only when a network is configured — no re-copy of the SDK body:Missing/unresolvable network membership raises the SDK's typed
ExposedPortUnavailableError.Test
uv run pytest— 248 passed.Link to Devin session: https://app.devin.ai/sessions/54414ea3ecb34ade9189534e5c690969
Requested by: @0xallam