Is this a reproducible bug?
Current behavior
When setting up the agent skill as described in https://herdr.dev/docs/agent-skill/ for codex, I found that the codex agent does not see any of the herdr-managed environment variables with !env. When asking it to manage subagents with herdr, it also fails to identify itself in HERDR_ENV=1 and falls back to codex-managed sessions.
Expected behavior
Should work as the docs say. The problem is probably with shell_environment_policy.inherit defaulting to "none" in codex. Setting it to "core" or "all" in ~/.codex/config.toml would let HERDR_* environment variables be correctly identified in codex sessions. Maybe the setting could be toggled in install_codex()?
|
let config_path = dir.join("config.toml"); |
|
let existing_config = if config_path.is_file() { |
|
fs::read_to_string(&config_path)? |
|
} else { |
|
String::new() |
|
}; |
|
let new_config = build_codex_config_with_hooks(&existing_config); |
|
if new_config != existing_config { |
|
fs::write(&config_path, new_config)?; |
|
} |
Ideally the change should also update shell_environment_policy.include_only to avoid unexpected inclusion of sensitive environment variables.
Reproduction
See current behavior.
Impact
Codex does not automatically manage subagents with herdr.
Environment
- Herdr version: 0.7.1
- Update channel (stable or preview): stable
- Operating system: Fedora Linux 44 (Server Edition) x86_64
- Terminal: Ghostty / Windows terminal via SSH connection
- Shell, if relevant: Fish
- Relevant config, if any:
Is this a reproducible bug?
Current behavior
When setting up the agent skill as described in https://herdr.dev/docs/agent-skill/ for codex, I found that the codex agent does not see any of the herdr-managed environment variables with
!env. When asking it to manage subagents with herdr, it also fails to identify itself inHERDR_ENV=1and falls back to codex-managed sessions.Expected behavior
Should work as the docs say. The problem is probably with
shell_environment_policy.inheritdefaulting to "none" in codex. Setting it to"core"or"all"in~/.codex/config.tomlwould letHERDR_*environment variables be correctly identified in codex sessions. Maybe the setting could be toggled ininstall_codex()?herdr/src/integration/targets.rs
Lines 211 to 220 in 659c3f5
Ideally the change should also update
shell_environment_policy.include_onlyto avoid unexpected inclusion of sensitive environment variables.Reproduction
See current behavior.
Impact
Codex does not automatically manage subagents with herdr.
Environment