Skip to content

fix(config): bridge docker_volumes and docker_forward_env in config set - #38611

Merged
benbarclay merged 2 commits into
NousResearch:mainfrom
Dusk1e:fix/config-bridge-docker-volumes-forward-env
Jun 4, 2026
Merged

fix(config): bridge docker_volumes and docker_forward_env in config set#38611
benbarclay merged 2 commits into
NousResearch:mainfrom
Dusk1e:fix/config-bridge-docker-volumes-forward-env

Conversation

@Dusk1e

@Dusk1e Dusk1e commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

What & why

terminal.* settings are read by terminal_tool from TERMINAL_* env
vars, so config values must be bridged into the environment at three points:

  1. cli.pyenv_mappings
  2. gateway/run.py_terminal_env_map
  3. hermes_cli/config.py:set_config_value_config_to_env_sync

terminal.docker_volumes and terminal.docker_forward_env were wired into
the first two but missing from the third. As a result, running:

hermes config set terminal.docker_volumes '["/host/proj:/workspace"]'

updated config.yaml but left the live process's TERMINAL_DOCKER_VOLUMES
stale — the bind mounts (and forwarded env vars) silently did nothing until
a full restart. Users saw "I saved the setting, but it isn't applied."

This is the same drift class already fixed for docker_run_as_host_user
and docker_mount_cwd_to_workspace.

Fix

Add both keys to _config_to_env_sync in set_config_value. No new
serialization logic is introduced: these are JSON-valued keys that
terminal_tool parses via json.loads, and the existing str(value)
path already produces valid JSON — identical to how the neighboring
terminal.docker_env key is handled. save_env_value() updates
os.environ and invalidates the env cache, so the change takes effect in
the running process immediately.

Tests

  • Added test_docker_volumes_is_bridged_everywhere and
    test_docker_forward_env_is_bridged_everywhere, pinning all four bridge
    points (the established pattern for this regression class).
  • Updated the test_save_config_set_supports_critical_bridged_keys
    docstring, which previously listed these two keys as known gaps.

How to test

hermes config set terminal.docker_volumes '["/host/proj:/workspace"]'
# TERMINAL_DOCKER_VOLUMES is now set in the active process;
# the mount applies without a restart.

Regression suite:

scripts/run_tests.sh tests/tools/test_terminal_config_env_sync.py

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/cli CLI entry point, hermes_cli/, setup wizard area/config Config system, migrations, profiles area/docker Docker image, Compose, packaging tool/terminal Terminal execution and process management labels Jun 4, 2026
@benbarclay
benbarclay merged commit 495c373 into NousResearch:main Jun 4, 2026
23 checks passed
davidgut1982 pushed a commit to davidgut1982/hermes-agent that referenced this pull request Jun 5, 2026
changman pushed a commit to changman/hermes-agent that referenced this pull request Jun 10, 2026
alt-glitch pushed a commit that referenced this pull request Jun 14, 2026
…et (#38611)

Co-authored-by: Ben Barclay <ben@nousresearch.com>
kossteg pushed a commit to kossteg/hermes-agent that referenced this pull request Jun 16, 2026
T02200059 pushed a commit to T02200059/hermes-agent that referenced this pull request Jun 18, 2026
xyshanren pushed a commit to xyshanren/hermes-agent-cn that referenced this pull request Jun 25, 2026
waefrebeorn pushed a commit to waefrebeorn/slermes that referenced this pull request Jul 2, 2026
santhreal pushed a commit to santhreal/hermes-agent that referenced this pull request Jul 13, 2026
donbowman pushed a commit to donbowman/hermes-agent that referenced this pull request Jul 13, 2026
Gravezzz pushed a commit to Gravezzz/hermes-agent that referenced this pull request Jul 21, 2026
leewenjie pushed a commit to leewenjie/hermes-agent that referenced this pull request Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/config Config system, migrations, profiles area/docker Docker image, Compose, packaging comp/cli CLI entry point, hermes_cli/, setup wizard P2 Medium — degraded but workaround exists tool/terminal Terminal execution and process management type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants