Module container

Module container 

Source
Expand description

Container management for container-type agent panes (Phase 1).

Manages persistent Docker containers — one per container agent. Each container runs the configured image (e.g. ghcr.io/agentmuxai/agent-claude) with tini as PID 1 and is kept alive between turns. Individual turns are executed via docker exec -i (no -t — avoids CR/LF corruption of NDJSON).

Platform support (cross-platform, matches SPEC_CONTAINER_PANE_SUPPORT_2026_06_11.md):

  • Windows: named pipe //./pipe/docker_engine
  • macOS: socket resolved via docker context inspect (Docker Desktop or Rancher)
  • Linux: /var/run/docker.sock or rootless path in XDG_RUNTIME_DIR

Independence boundary: this module has no dependency on a5af/claw. Docker best practices here were researched independently.

Structs§

ContainerManager
Shared container manager. Clone-on-Arc; cheap to pass around.
ContainerManagerInner 🔒
ExecSession
Exec session handle for a single turn.

Enums§

ContainerError
Errors from container operations.

Constants§

CONTAINER_ENV_DENYLIST
Env var names that reference host-filesystem paths and must NOT be forwarded into a container via docker exec -e. The container image supplies its own values for these (e.g. CLAUDE_CONFIG_DIR=/home/agent/.claude baked in).

Functions§

container_name_for_slug
Derive the stable container name for an agent from its slug. Format: agentmux-<slug>. Deterministic so restarts reuse the same container.
parse_volume_spec 🔒
Parse a Docker volume spec into (source, target, read_only).