Home Directory (`~`) Expansion in Unix Socket Paths
What variant of Codex are you using?
App / CLI / IDE (local)
What feature would you like to see?
In developing a set of enterprise-managed permissions profile, we've run into a limitation with our ability to define unix sockets. For example, in an attempt to enable GPG signing of git commits, we would have wanted to do something like this:
# requirements.toml
[permissions.profile_name.network.unix_sockets]
"~/.gnupg/S.gpg-agent" = "allow"
"~/.gnupg/S.gpg-agent.extra" = "allow"
# or [experimental_network.unix_sockets] ...
But this is rejected, as the unix socket config seems to be expecting an absolute path:
$ codex resume
Error: Failed to resume session from [...]: thread/resume failed during TUI bootstrap:
thread/resume failed: error resuming thread: Fatal error: Failed to initialize session:
failed to start managed network proxy: failed to build network proxy state:
invalid network.allow_unix_sockets[0] (code -32603)
And for an enterprise-managed profile, needing to work across a variety of (potentially multi-user) systems, workarounds like moving/symlinking the socket to a hard-coded absolute path don't seem tenable.
Special-casing the expansion of a leading ~ in unix_socket paths would solve this specific issue. A more general solution might be supporting environment expansion in Codex configs, such as proposed in #2680.
Additional information
_No response_
2 Comments
I put together a narrow fix for this on a fork branch:
https://github.com/openai/codex/compare/main...Nicolas0315:codex:codex/unix-socket-tilde-expansion?expand=1
Commit: Nicolas0315/codex@95d061b4b
What changed:
network.allow_unix_socketsvalidation now expands~and~/...before enforcing the absolute-path requirement.~user/...remains unsupported/rejected, so this is intentionally limited to the current user's home directory.x-unix-socketpath matches a~/...allowlist entry.Verification:
just fmt;just test -p codex-network-proxy;cargo check --manifest-path codex-rs\Cargo.toml -p codex-network-proxy;git diff --checkrtx4090:just test -p codex-network-proxy(192 passed)cyberagent-mac-m5max: fresh clone + patch; focusedresolve_runtime_; focusedunix_socket_allowlist_expands_home_relative_entries; fullcargo test --manifest-path codex-rs/Cargo.toml -p codex-network-proxy(198 passed)rtx5060ti: patch applied, Rust test blocked by linker/MSVC toolchain issue (link.exeresolves to an incompatible linker)nicolas2025: patch applied/static check, Rust blocked by zero-bytecargo/rustcnicolas-macbook-pro: patch applied, Rust blocked because Cargo is unavailableI tried to open an upstream PR, but GitHub returned
Nicolas0315 does not have the correct permissions to execute CreatePullRequest, so I’m leaving the compare link here.Hi @hoffmanr-cshs, the frozen history/resume behavior you described is one of the persistence patterns I've been studying. Codex Rescue Alpha5 includes a read-only projection consistency check that compares canonical rollout progress against stored projection cursors without touching SQLite.
If you still have the affected pre-repair session locally, you can test it with:
(or point
doctordirectly to the rollout file). Please sanitize/redact any sensitive paths or names before sharing diagnostic output; raw session files are never needed.