Files
dev/.devcontainer
zeekay 25f1f1da4f vendor: upstream lives under vendor/, so ours is what is left
codex-rs/ is a read-only mirror of openai/codex that just-every refreshes and
we never edit. It sat at the repo root next to code-rs/, the product, and the
only thing separating them was that everyone knew. Nothing checked it.

That knowing is what makes branding endless. There are ~400 upstream-brand
literals in code-rs today and ~224 of ours, hand-placed on the same lines the
sync delta lands on, so every sync re-fights the same 17 files. You cannot fix
that while the line between "theirs" and "ours" is a convention.

vendor/codex/ makes it a boundary. Everything under vendor/ is upstream: never
branded, never edited, replaced wholesale on sync. Everything outside it is
ours and must carry our name — which is now a question a test can ask.

code-rs coupled to the mirror through exactly one line, an include_str! of
models.json, and it still does. The other 17 files are path strings.

Syncing changes by one sed: just-every's delta names codex-rs/, so rewrite the
patch paths to vendor/codex/ before applying it.
2026-08-07 21:22:34 -07:00
..

Containerized Development

We provide two container paths:

  • devcontainer.json keeps the existing Codex contributor setup for working on this repository.
  • devcontainer.secure.json adds a customer-oriented profile with stricter outbound network controls.

Codex contributor profile

Use devcontainer.json when you are developing Codex itself. This is the same lightweight arm64 container that already exists in the repo.

Secure customer profile

Use devcontainer.secure.json when you want a stricter runtime profile for running Codex inside a project container:

  • installs the Codex CLI plus common build tools
  • installs bubblewrap in setuid mode for Codex's Linux sandbox
  • disables Docker's outer seccomp and AppArmor profiles so bubblewrap can construct Codex's inner sandbox
  • enables firewall startup with an allowlist-driven outbound policy
  • blocks IPv6 by default so the allowlist cannot be bypassed over AAAA routes
  • requires NET_ADMIN and NET_RAW so the firewall can be installed at startup

This profile keeps the stricter networking isolated to the customer path instead of changing the default Codex contributor container.

Start it from the CLI with:

devcontainer up --workspace-folder . --config .devcontainer/devcontainer.secure.json

In VS Code, choose Dev Containers: Open Folder in Container... and select .devcontainer/devcontainer.secure.json.

Docker

To build the contributor image locally for x64 and then run it with the repo mounted under /workspace:

CODEX_DOCKER_IMAGE_NAME=codex-linux-dev
docker build --platform=linux/amd64 -t "$CODEX_DOCKER_IMAGE_NAME" ./.devcontainer
docker run --platform=linux/amd64 --rm -it -e CARGO_TARGET_DIR=/workspace/vendor/codex/target-amd64 -v "$PWD":/workspace -w /workspace/codex-rs "$CODEX_DOCKER_IMAGE_NAME"

Note that /workspace/target will contain the binaries built for your host platform, so we include -e CARGO_TARGET_DIR=/workspace/vendor/codex/target-amd64 in the docker run command so that the binaries built inside your container are written to a separate directory.

For arm64, specify --platform=linux/arm64 instead for both docker build and docker run.

Currently, the contributor Dockerfile works for both x64 and arm64 Linux, though you need to run rustup target add x86_64-unknown-linux-musl yourself to install the musl toolchain for x64.

The secure profile's capability, seccomp, and AppArmor options are required when you want Codex's bubblewrap sandbox to run inside Docker as the non-root devcontainer user. Without them, Docker's default runtime profile can block bubblewrap's namespace setup before Codex's own seccomp filter is installed. This keeps the Docker relaxation explicit in the profile that is meant to run Codex inside a project container, while the default contributor profile stays lightweight.