fix(codex): drop heavy host-only artifacts from codex config staging#125
Merged
Conversation
The host `~/.codex` is ~1.1 GB and was being synced into boxes almost whole: ~485 MB of macOS aarch64 standalone release binaries (`packages/`), a ~238 MB plugin app-server runtime (`plugins/.plugin-appserver`), the macOS `Codex Computer Use.app` bundle (`computer-use/`), host session archives, and regenerable caches (`.tmp` ~213 MB, `tmp`, `cache`, `vendor_imports`, `sqlite`, `models_cache.json`). None of it is usable in a Linux box — the in-box codex is npm-installed and rebuilds these caches on demand. Exclude all of it from both codex staging paths: - `CODEX_RSYNC_EXCLUDES` (host-stage.ts) — the cloud bake path (hetzner/vercel/ e2b/daytona `stageCodexStaticForUpload`). Dry-run: staged tarball 820 MB -> 482 KB. - the docker `agentbox-codex-config` volume rsync (codex.ts), plus its `rm -rf` purge so existing shared volumes get cleaned on the next sync. Verified live: a fresh docker box's `~/.codex` dropped 1.5 GB -> 59 MB and `codex exec` still returns a real turn. Config / auth / skills / prompts / rules / memories / plugins are still synced, so codex keeps working — just without the host-only ballast. Claude-Session: https://claude.ai/code/session_019m5WHxP4vmsoXaHUhQdY9e
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
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.
Problem
Host
~/.codexis ~1.1 GB and was synced into boxes almost whole — ~800 MB of it is macOS-host artifacts useless in a Linux box:packages/standaloneplugins/.plugin-appservercomputer-useCodex Computer Use.appmacOS bundle.tmparchived_sessions,tmp,cache,vendor_imports,sqlite,models_cache.jsonThis made the
scp codex staticstep during cloudprepare(and the docker volume sync on every create) crawl.Fix
Exclude the heavy host-only dirs from both codex staging paths:
CODEX_RSYNC_EXCLUDES,host-stage.ts) — used by hetzner/vercel/e2b/daytonastageCodexStaticForUpload.codex.ts, theagentbox-codex-configrsync) — plus the matchingrm -rfpurge so existing shared volumes get trimmed on the next sync.Config / auth / skills / prompts / rules / memories / plugins are still synced, so codex keeps working.
Verification
../agentbox-test-repo-gh—~/.codex1.5 GB → 59 MB, all junk dirs purged, kept config intact, andcodex execreturned a realPONG. All 297sandbox-dockertests pass.https://claude.ai/code/session_019m5WHxP4vmsoXaHUhQdY9e
Note
Low Risk
Narrow rsync/staging filter changes with no auth or config semantics changes; only drops host artifacts that are useless in-box.
Overview
Stops copying macOS-only and regenerable bulk from the host
~/.codexinto Linux sandboxes, which had been inflating cloud prepare tarballs and Dockeragentbox-codex-configsyncs to hundreds of MB or ~1.5 GB.Cloud prepare (
CODEX_RSYNC_EXCLUDESinhost-stage.ts) now skipspackages,plugins/.plugin-appserver,computer-use, andarchived_sessions, alongside existing cache/runtime excludes.Docker volume sync (
ensureCodexVolumeincodex.ts) applies the same rsync excludes and extends the post-syncrm -rfpurge so volumes that already absorbed those paths get trimmed on the next create. Config, auth, skills, prompts, and other real settings still sync.Reviewed by Cursor Bugbot for commit e3f7193. Configure here.