You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On Linux Codex runs inside scripts/run_in_container.sh.
Inside the container Codex looks for configs at /home/node/.codex (instructions, approval presets, session logs).
Because the host $HOME/.codex is not bind‑mounted today, every container start loses those files — users cannot persist settings or share them between runs.
Proposed solution
Add a conditional bind mount in run_in_container.sh
if [[ -e"$HOME/.codex" ]];then
docker_flags+=("-v""$HOME/.codex:/home/node/.codex:ro")
fi```*No directory ⇒ no mount ⇒ zero breakage.*
Allow an override flag--config PATH so power‑users can point to an alternative folder/file (future‑proof for dot‑file minimalists). ([GitHub][1])
Keep the mount read‑only; the container already writes logs under /home/node/.codex/log, which is safe. ([GitHub][2])
Mounting is a five‑line change that removes an entire class of “Codex forgets my settings” tickets and aligns Linux with macOS behaviour. ([GitHub][6])
Acceptance criteria
run_in_container.sh mounts $HOME/.codex when present.
Codex inside the container loads the user’s config.json and shows the chosen approval mode in the banner.
Script behaves exactly as before when the directory is absent.
New Vitest e2e verifies that a temp config file becomes visible inside the container. (Tests folder already exists ([npm][7]))
Checklist
implementation
unit / e2e test
README “Linux sandbox” section updated
passes pnpm test && pnpm lint && pnpm typecheck
Happy to submit the accompanying PR once #783 lands. 🚀
The text was updated successfully, but these errors were encountered:
Enables users to persist Codex CLI configuration
across container runs by optionally mounting their
local `.codex` directory using the `--config` parameter.
Fixesopenai#789
What problem does this solve?
scripts/run_in_container.sh
.Inside the container Codex looks for configs at
/home/node/.codex
(instructions, approval presets, session logs).Because the host
$HOME/.codex
is not bind‑mounted today, every container start loses those files — users cannot persist settings or share them between runs.Proposed solution
run_in_container.sh
--config PATH
so power‑users can point to an alternative folder/file (future‑proof for dot‑file minimalists). ([GitHub][1])/home/node/.codex/log
, which is safe. ([GitHub][2])Relationship to #781 / #783
--full-auto
flag, which is a prerequisite — otherwise the wrapper would still ignore CLI flags stored inconfig.json
. ([GitHub][3])main
after fix(run_in_container): drop hardcoded --full-auto flag #783 is merged.Why now?
approvalMode
,safeCommands
, etc., viaconfig.json
. (e.g. bug: ECONNREFUSED when using run_in_container #480, Container script firewall is overly restrictive #376, feat: command whitelists #511) ([GitHub][4], [GitHub][2], [GitHub][5])Acceptance criteria
run_in_container.sh
mounts$HOME/.codex
when present.config.json
and shows the chosen approval mode in the banner.Checklist
pnpm test && pnpm lint && pnpm typecheck
The text was updated successfully, but these errors were encountered: