feat: add Codex sandbox wrapper, engine selection, and pre-commit hooks - #6
Merged
Conversation
e6qu
force-pushed
the
codex-cli-sandbox-support
branch
from
May 21, 2026 11:15
a33aec9 to
638d1da
Compare
Safety / correctness: - cleanup.sh: guard for macOS-only (referenced ~/.Trash and applehv paths); replace `rm -rf "$HOME/.Trash"/*` with `find` (set -e + empty/dotfile-only Trash aborted the script) - sclaude/scodex: trap INT/TERM/HUP in addition to EXIT so temp Dockerfiles are cleaned up on signals - sclaude/scodex: `reset` refuses non-TTY stdin without SAGENT_ASSUME_YES=1; previously `read -r` returned immediately on piped/CI stdin and silently deleted volumes - scodex: reject CODEX_HOME symlinks (whole-dir and per-file) in sync_codex_config_files to prevent following attacker-controlled symlinks through the read-only mount - sclaude/scodex: pass secrets via `-e VAR` (no =) so values no longer appear in `docker run` argv (visible in `ps -ef` and `docker inspect`) Efficiency / quality: - sclaude/scodex: cache HOST_UID/HOST_GID once at startup (was forking id -u / id -g 4-6 times per run) - sclaude/scodex: create_volumes now runs one `volume ls` and creates only missing volumes (was 6 sequential `volume create` calls every run; high impact on Podman/macOS VM round-trips) - sclaude/scodex: collapse build_image if/else into a single invocation with a build_args array - sclaude/scodex: cleanup_images uses one combined `grep -vE` filter Env var coverage (verified against current Claude Code and Codex docs): - sclaude: pass through ANTHROPIC_AUTH_TOKEN, ANTHROPIC_BASE_URL, ANTHROPIC_MODEL, CLAUDE_CODE_OAUTH_TOKEN (the OAuth token is required for paid Claude.ai users who don't have an API key) - scodex: rename OPENAI_ORG_ID -> OPENAI_ORGANIZATION and OPENAI_PROJECT_ID -> OPENAI_PROJECT (Codex CLI follows Python SDK convention, not Node); add SSL_CERT_FILE (documented fallback when CODEX_CA_CERTIFICATE unset) Tests: - test_e2e.sh T09: use SAGENT_ASSUME_YES=1 instead of `echo "" |` (matches the new reset guard; the old form would now fail correctly)
e6qu
force-pushed
the
codex-cli-sandbox-support
branch
from
May 21, 2026 11:48
a10f847 to
a1f0a18
Compare
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
scodexwrapper for OpenAI Codex CLI alongsidesclaude, sharing one Docker image with both CLIs installedsclaude-config,scodex-config) and shared user volumes for/home/agent,.npm-global,.local, and apt cache/listsSAGENT_CONTAINER_ENGINE=docker|podmanwith bounded health checks (default: Docker, then Podman)auth.json) and config (config.toml,instructions.md,AGENTS.md) from the host into the sandbox--dangerously-skip-permissionsfor Claude,--dangerously-bypass-approvals-and-sandboxfor Codex;--no-yoloopts outcleanup.shmacOS helper for reclaiming local disk and Docker/Podman stateSAGENT_SKIP_RELEASE_CHECK=1disablesTooling
.pre-commit-config.yamlwiring up actionlint, shellcheck, bash/zsh syntax checks, Conventional Commits validation, and AI-attribution stripping oncommit-msgmain); E2E/devcontainer jobs still gated to same-repo PRs to keep secrets safe from fork PRssclaudeandscodexas release assets and rewrites release notes with install/update commands for bothTesting
pre-commit run --all-files(all hooks green)shellcheck sclaude scodex test_e2e.sh test_devcontainers.sh cleanup.shbash -nandzsh -non both wrapper scriptsTEST_TIMEOUT_SECONDS=900 bash test_e2e.sh(Docker)SAGENT_CONTAINER_ENGINE=podman TEST_TIMEOUT_SECONDS=900 bash test_e2e.shTEST_TIMEOUT_SECONDS=120 bash test_devcontainers.sh