Linux: inherited Herdr environment variables are unavailable to tools and subagents
Codex version
0.150.1
Subscription
ChatGPT account login (subscription tier is not exposed to the CLI)
Model
gpt-5.6-sol
Platform
- Linux aarch64
- Raspberry Pi OS 13 (trixie), 64-bit
- Kernel 6.18.34+rpt-rpi-2712
- Standalone Codex CLI
Terminal / multiplexer
- Bash
- Herdr 0.8.2 (PTY workspace/tab/pane multiplexer)
Sanitized codex doctor --json summary
{
"codexVersion": "0.150.1",
"model": "gpt-5.6-sol",
"platform": "linux-aarch64",
"os": "Raspberry Pi OS 13.0.0 (trixie) [64-bit]",
"sandbox": "restricted"
}
Actual behavior
Herdr injects these variables into each pane shell before Codex starts:
HERDR_ENV=1
HERDR_WORKSPACE_ID=<workspace-id>
HERDR_TAB_ID=<tab-id>
HERDR_PANE_ID=<pane-id>
They are visible from the interactive Bash shell in a Herdr tab. However,
commands executed by Codex cannot see any HERDR_* variables, and agents
spawned by Codex cannot see them either.
Adding the following configuration and restarting Codex does not help:
[shell_environment_policy]
inherit = "all"
Runtime inspection shows tool commands execute beneath codex-linux-sandbox
as PID 1. /proc/1/environ already lacks the Herdr variables, so the variables
appear to be removed before shell_environment_policy is applied. The generated
shell snapshot also lacks them.
The equivalent Herdr/Codex workflow works on macOS but fails on Linux.
Steps to reproduce
- Start a Herdr workspace and open a tab on Linux.
- In the pane shell, verify the injected variables:
``bash``
env | grep '^HERDR_'
- Start Codex from that Herdr tab.
- Ask Codex to execute:
``bash``
env | grep '^HERDR_'
- Observe that there is no output.
- Spawn an agent and ask it to run the same command; it also receives no Herdr
variables.
- Set
shell_environment_policy.inherit = "all", restart Codex, and repeat.
The result is unchanged.
Expected behavior
Environment variables present in the shell that launches Codex should be
available to Codex tool commands and spawned agents when environment inheritance
is enabled.
At minimum, shell_environment_policy.inherit = "all" should not lose variables
before applying the configured policy.
Additional context
Potentially related, but not exact duplicates:
- #3064 — configuration for inherited environment variables
- #29138 — remote app-server launched with a scrubbed environment
A more detailed redacted codex doctor --json report can be provided if needed.