Skip to content

The agent that grows with you

fix(config): register terminal.client_env_passthrough with an empty default

unsupportedpastels421a6f5cfdcd
diff --git a/cli-config.yaml.example b/cli-config.yaml.example
index 036c5a7b060..fe644579d32 100644
--- a/cli-config.yaml.example
+++ b/cli-config.yaml.example
@@ -435,10 +435,11 @@ terminal:
# start with the launching shell's toolchain: PATH, VIRTUAL_ENV and CONDA_* / NODE_* / NVM_* /
# PYENV_* (plus GOPATH, GOROOT, CARGO_HOME, RUSTUP_HOME, JAVA_HOME), for that session only, when
# the client runs on the gateway's host (a remote client's session keeps the gateway's toolchain).
- # List more non-secret names here; names execute_code treats as credentials (…TOKEN, …KEY,
- # …SECRET, …PASSWORD, …AUTH, …DSN, …WEBHOOK, …CREDS, …BEARER, …COOKIE) and HERMES_* names are
- # never sent: pass secrets with `env_passthrough` instead.
- # client_env_passthrough: ["GEM_HOME", "POETRY_HOME"]
+ # A toolchain name the client did not export is unset for its session's tools (PATH excepted).
+ # List more non-secret names here (default: none); names execute_code treats as credentials (…TOKEN,
+ # …KEY, …SECRET, …PASSWORD, …AUTH, …DSN, …WEBHOOK, …CREDS, …BEARER, …COOKIE) and HERMES_* names
+ # are never sent: pass secrets with `env_passthrough` instead.
+ client_env_passthrough: [] # e.g. ["GEM_HOME", "POETRY_HOME"]
# sudo_password: "hunter2" # Optional: pipe a sudo password via sudo -S. SECURITY WARNING: plaintext.
# sudo_password: "" # Explicit empty password: try empty and never open the interactive sudo prompt.
diff --git a/hermes_cli/config_defaults.py b/hermes_cli/config_defaults.py
index d522dd9ba8d..6bdd879736f 100644
--- a/hermes_cli/config_defaults.py
+++ b/hermes_cli/config_defaults.py
@@ -323,9 +323,9 @@ DEFAULT_CONFIG = {
# Bounded linger (seconds) for one-shot CLI runs (-q/-Q/-z) that exit while background processes
# spawned with notify_on_complete=true are still running. See #90879.
"oneshot_completion_wait_seconds": 600.0,
- # Env vars passed into sandboxed terminal/execute_code (skill-declared
- # required_environment_variables pass through automatically).
+ # Env vars passed into sandboxed terminal/execute_code (plus skill-declared required_environment_variables).
"env_passthrough": [],
+ "client_env_passthrough": [], # Extra non-secret toolchain names a CLI/TUI client sends for its tools
# Remote-backend sync-back refuses to extract a downloaded state archive larger than this
# (bytes); raise it for a ~/.hermes tree that legitimately exceeds 2 GiB.
"sync_back_max_bytes": 2 * 1024 * 1024 * 1024,
diff --git a/tests/hermes_cli/test_config_client_env_passthrough.py b/tests/hermes_cli/test_config_client_env_passthrough.py
new file mode 100644
index 00000000000..8f053a388ec
--- /dev/null
+++ b/tests/hermes_cli/test_config_client_env_passthrough.py
@@ -0,0 +1,21 @@
+"""``terminal.client_env_passthrough`` (a shell client's extra toolchain names) is a registered key."""
+import os
+from unittest.mock import patch
+
+from hermes_cli.config import DEFAULT_CONFIG, load_config, save_config
+
+
+def test_default_and_user_list_round_trip(tmp_path):
+ from agent.session_client_env import configured_names
+ from hermes_cli.config import _validate_config_key
+ assert DEFAULT_CONFIG["terminal"]["client_env_passthrough"] == []
+ assert _validate_config_key("terminal.client_env_passthrough") == (True, None)
+ names = ["GEM_HOME", "POETRY_HOME"]
+ with patch.dict(os.environ, {"HERMES_HOME": str(tmp_path)}):
+ assert load_config()["terminal"]["client_env_passthrough"] == []
+ (tmp_path / "config.yaml").write_text("terminal:\n client_env_passthrough: [GEM_HOME, POETRY_HOME]\n")
+ config = load_config()
+ assert config["terminal"]["client_env_passthrough"] == names
+ assert configured_names(config) == set(names)
+ save_config(config)
+ assert load_config()["terminal"]["client_env_passthrough"] == names
diff --git a/website/docs/user-guide/configuration.md b/website/docs/user-guide/configuration.md
index f94a841e884..6732b8727c5 100644
--- a/website/docs/user-guide/configuration.md
+++ b/website/docs/user-guide/configuration.md
@@ -233,6 +233,7 @@ terminal:
timeout: 180 # Per-command timeout in seconds
home_mode: auto # auto | real | profile — subprocess HOME policy
env_passthrough: [] # Env var names to forward to sandboxed execution (terminal + execute_code)
+ client_env_passthrough: [] # Extra non-secret toolchain names (e.g. GEM_HOME) a local CLI/TUI session's tools take from its launching shell
sync_back_max_bytes: 2147483648 # Remote backends: refuse to extract a state archive larger than this (bytes)
singularity_image: "docker://nousresearch/hermes-sandbox:desktop" # Container image for Singularity backend
modal_image: "nousresearch/hermes-sandbox:desktop" # Container image for Modal backend