Skip to content

fix(terminal): lazy-parse Docker env config#42733

Merged
benbarclay merged 1 commit into
NousResearch:mainfrom
BROCCOLO1D:fix/42725-lazy-docker-env-parsing
Jun 10, 2026
Merged

fix(terminal): lazy-parse Docker env config#42733
benbarclay merged 1 commit into
NousResearch:mainfrom
BROCCOLO1D:fix/42725-lazy-docker-env-parsing

Conversation

@BROCCOLO1D

Copy link
Copy Markdown
Contributor

Summary

  • Defer parsing Docker-only JSON terminal env vars until the Docker backend is selected.
  • Use safe Docker defaults for local/ssh so stale malformed Docker config cannot break subprocess tools.
  • Keep Docker backend validation intact with a clear TERMINAL_DOCKER_VOLUMES error for bad JSON.

Why

TERMINAL_DOCKER_VOLUMES=None and similar malformed Docker-only env/config values were parsed eagerly inside terminal config loading, which could crash the default local backend before Docker was ever used.

Changes

  • Gate Docker JSON parsing on TERMINAL_ENV=docker.
  • Gate generic container resource parsing to container-style backends.
  • Add regression coverage for local, ssh, and Docker backend behavior.

Validation

  • python -m ruff check tools/terminal_tool.py tests/tools/test_terminal_tool.py
  • python -m pytest tests/tools/test_terminal_tool.py tests/tools/test_terminal_config_env_sync.py -o 'addopts=' -q

Scope

Focused terminal config parsing regression fix only.

Closes #42725

@alt-glitch alt-glitch added type/bug Something isn't working tool/terminal Terminal execution and process management tool/code-exec execute_code sandbox backend/docker Docker container execution P1 High — major feature broken, no workaround labels Jun 9, 2026
@benbarclay benbarclay merged commit 2903615 into NousResearch:main Jun 10, 2026
23 checks passed
wachoo pushed a commit to wachoo/hermes-agent that referenced this pull request Jun 10, 2026
Co-authored-by: BROCCOLO1D <279959838+BROCCOLO1D@users.noreply.github.com>
changman pushed a commit to changman/hermes-agent that referenced this pull request Jun 10, 2026
Co-authored-by: BROCCOLO1D <279959838+BROCCOLO1D@users.noreply.github.com>
alt-glitch pushed a commit that referenced this pull request Jun 14, 2026
Co-authored-by: BROCCOLO1D <279959838+BROCCOLO1D@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend/docker Docker container execution P1 High — major feature broken, no workaround tool/code-exec execute_code sandbox 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.

[Bug]: TERMINAL_DOCKER_VOLUMES parsed eagerly with json.loads regardless of terminal.backend, crashes all subprocess tools

3 participants