feat: add codex agent support to sandbox container

- Install @openai/codex in Dockerfile.sandbox
- Pass developer_instructions via -c flag with proper shell escaping
- Use --yolo flag for sandbox profile (container is the sandbox)
- Mount ~/.codex into container via workmux extra_mounts config

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
centdix
2026-02-21 19:27:30 +00:00
co-authored by Claude Opus 4.6
parent ab91f78017
commit 0db6cbd10c
2 changed files with 7 additions and 2 deletions
+3
View File
@@ -144,6 +144,9 @@ RUN curl -fsSL https://claude.ai/install.sh | bash && \
ln -s /usr/local/bin/claude /tmp/.local/bin/claude && \
chmod 777 /tmp/.local
# --- codex agent ---
RUN npm i -g @openai/codex
# Entrypoint that registers the dynamic UID in /etc/passwd so sudo works.
# workmux passes --user UID:GID directly, bypassing network-init.sh.
RUN cat <<'ENTRY' > /usr/local/bin/entrypoint.sh
+4 -2
View File
@@ -105,9 +105,11 @@ function buildAgentCmd(profile: Profile, env: Record<string, string>, agent: Age
if (agent === "codex") {
if (profile === "agent-yolo") {
return `workmux sandbox agent -- codex --yolo`;
const innerEscaped = prompt.replace(/["\\$`]/g, "\\$&");
return `workmux sandbox agent -- codex --yolo -c '"developer_instructions=${innerEscaped}"'`;
}
return "codex";
const escapedPrompt = prompt.replace(/'/g, "'\\''");
return `codex -c 'developer_instructions=${escapedPrompt}'`;
}
// Claude