exoharness: fix find_running_warm_sandbox to work on Docker (Linux)#43
Open
akrentsel wants to merge 1 commit into
Open
exoharness: fix find_running_warm_sandbox to work on Docker (Linux)#43akrentsel wants to merge 1 commit into
akrentsel wants to merge 1 commit into
Conversation
find_running_warm_sandbox unconditionally called
<bin> list --format json
which is Apple Container CLI syntax. On Docker (the Linux default), the
`list` subcommand doesn't exist and the call failed with "unknown flag:
--format", which surfaced as `failed to list warm sandboxes` on the
first sandbox provision attempt. Linux Docker users couldn't run agents
that touch a sandbox without working around it.
Fix: dispatch on cli flavor.
- AppleContainer path = existing implementation, unchanged.
- Docker path uses `docker ps --filter label=KEY=VALUE --format
'{{json .}}'`, parses one JSON object per line, decodes the
comma-separated Labels field, and matches on spec_hash. The
server-side label filter narrows results; `docker ps` (without
`-a`) only returns running containers, matching the existing
Apple semantics.
- Adds a small DockerPsItem + parse_docker_labels helper, plus a
unit test for the label parser.
End-to-end verified locally: with `sandbox_provider: docker` on
Linux, the agent now provisions a container, executes a shell tool
call, and returns the result.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.
find_running_warm_sandboxunconditionally calledwhich is Apple Container CLI syntax. On Docker (the Linux default),
listisn't a subcommand and the call fails withunknown flag: --format, which surfaces asfailed to list warm sandboxeson the first sandbox provision attempt. Linux Docker users can't run agents that touch a sandbox without working around it.Fix
Dispatch
find_running_warm_sandboxonContainerCliFlavor:find_running_warm_sandbox_apple.find_running_warm_sandbox_dockerusesdocker pswith three server-side filters (status=running, key label, spec-hash label) plus--format '{{json .}}'. Each output line is a JSON object; we deserialize into a 1-fieldDockerPsItem { names }and return the first. No client-side label parsing required.run_container_admin_commandhelper for the subprocess spawn + timeout, matching the Apple sibling.Test plan
cargo check --all-targets✅cargo clippy --all-targets -- -D warnings✅cargo fmt --check✅sandbox_provider: dockeron an agent, sending a message triggersdocker runfor a fresh warm sandbox, the shell tool executes inside it (echo linux-docker-fixed), and the result returns through to the assistant. Before this change the same flow erroored withfailed to list warm sandboxes: unknown flag: --formatbefore any container was provisioned.