Repository navigation
Run the chat coding adapter's commands in a per-turn container (cwl-runner style) - #74
Merged
Merged
Conversation
, chian#73 stage 1) The Argo chat-completions coding adapter (chian#67) confined its file tools to the coding workspace, but run_command was /bin/sh as the user: in the first live build 64 of 75 commands read outside the workspace, and nothing prevented reading host credentials, writing elsewhere, or reaching the network. When the Run executor is the container backend, run_command now executes in a per-turn container, the way a CWL runner executes a tool: - docker run -d --rm --network none --read-only --cap-drop ALL --security-opt no-new-privileges --user <workspace owner> --tmpfs /tmp, the executor's resource limits and digest-pinned image; - the coding workspace is the only writable mount (at its own path), and OpenChia's sources are mounted read-only at /ctx/openchia on PYTHONPATH; - each command is a docker exec (~60 ms); a timeout or interrupt removes the container (killing everything inside) and the next command restarts it; - a runtime that cannot start is reported to the model; there is no host shell fallback. The model loop stays on the host; other backends and the systemd Run backend keep their current behaviour (chian#73 stages 2-4). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
wilke
added a commit
to wilke/OpenChia
that referenced
this pull request
Oct 8, 2026
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.
Stage 1 of #73; addresses #72 for the Argo chat-completions coding adapter (#67).
Problem
#67's adapter confines its file tools to the coding workspace, but
run_commandwas/bin/sh -crunning as the user. In the first live refiner build, 64 of 75 commands read outside the workspace: OpenChia's installed sources and earlier source packages. Nothing prevented reading host credentials (~/.hermes/.env), writing elsewhere, or reaching the network.Change
New
agent/transports/coding_container.py(ContainerCommandShell,container_shell_for). When the Run executor is the container backend,iterative_episode_refiner/coding.pygives the chat adapter a per-turn container shell, andrun_commandexecutes there, the way a CWL runner executes a tool:/ctx/openchiaonPYTHONPATH, so diagnostics can import the libraries without browsing the host. The system message tells the model this.docker exec.error: container shell unavailable ….Verification
tests/agent/test_coding_container_shell.py, 6 tests with a fake Docker CLI:run_commandthrough the shell.Together with the existing adapter tests: 16 pass.
Real Docker 29.5.3 on macOS (
python:3.14-slim):/Usersand~/.hermesabsent;import method_loopworks from/ctx/openchia;Not in this PR (#73)
site-packagesmounted read-only).sbxis the candidate.🤖 Generated with Claude Code