Skip to content

fix(terminal): respect config.yaml docker_image and terminal settings…#4350

Closed
devorun wants to merge 1 commit into
NousResearch:mainfrom
devorun:patch-23
Closed

fix(terminal): respect config.yaml docker_image and terminal settings…#4350
devorun wants to merge 1 commit into
NousResearch:mainfrom
devorun:patch-23

Conversation

@devorun

@devorun devorun commented Mar 31, 2026

Copy link
Copy Markdown
Contributor

… (#4344)

What does this PR do?

Fixes #4344

The Issue:
The _get_env_config() function in tools/terminal_tool.py was exclusively reading from environment variables (os.getenv) and falling back to a hardcoded default image (nikolaik/python-nodejs...). It completely ignored the terminal block configurations specified in config.yaml, causing assigned images like rust:trixie to be bypassed entirely.

The Fix:
Updated _get_env_config() to safely load the terminal block from config.yaml as the primary fallback before using the hardcoded default values. This ensures that user-defined settings for docker_image, cwd, and other container configurations are correctly respected across all terminal backends without breaking existing environment variable overrides.

Related Issue

Fixes #

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

How to Test

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform:

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

For New Skills

  • This skill is broadly useful to most users (if bundled) — see Contributing Guide
  • SKILL.md follows the standard format (frontmatter, trigger conditions, steps, pitfalls)
  • No external dependencies that aren't already available (prefer stdlib, curl, existing Hermes tools)
  • I've tested the skill end-to-end: hermes --toolsets skills -q "Use the X skill to do Y"

Screenshots / Logs

malaiwah added a commit to malaiwah/hermes-agent that referenced this pull request Apr 5, 2026
…ge config and invalid workdir bypass

- PR NousResearch#4350: Load config.yaml terminal block as fallback before hardcoded defaults
  - Fixes docker_image in config.yaml not being loaded
  - Adds cfg.get() fallbacks for all terminal config options

- PR NousResearch#4673: Don't clobber already-resolved absolute TERMINAL_CWD
  - Fixes invalid workdir bypassing terminal.cwd config
  - Skips config override when env var already has absolute path
malaiwah added a commit to malaiwah/hermes-agent that referenced this pull request Apr 11, 2026
…ge config and invalid workdir bypass

- PR NousResearch#4350: Load config.yaml terminal block as fallback before hardcoded defaults
  - Fixes docker_image in config.yaml not being loaded
  - Adds cfg.get() fallbacks for all terminal config options

- PR NousResearch#4673: Don't clobber already-resolved absolute TERMINAL_CWD
  - Fixes invalid workdir bypassing terminal.cwd config
  - Skips config override when env var already has absolute path
@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the contribution, @devorun! This is an automated hermes-sweeper review.

After inspecting current main, the behavior described in #4344 is already addressed by an existing config-to-environment-variable bridge:

  • cli.py lines 505–578load_cli_config() reads the terminal block from config.yaml and maps docker_image → TERMINAL_DOCKER_IMAGE (along with all other terminal settings) into the process environment before any tool call reaches _get_env_config().
  • gateway/run.py lines 107–158 — module-level startup code applies the same mapping so the gateway path is also covered.
  • _get_env_config() in tools/terminal_tool.py line 896 then reads TERMINAL_DOCKER_IMAGE via os.getenv, which by that point holds the user's config value.

Adding a second config.yaml read directly inside _get_env_config() would duplicate this existing mechanism and could cause priority conflicts between the two load paths. The underlying issue #4344 should be re-tested against a current install to confirm whether it's already resolved there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: docker_image in config.yaml doesn't load assigned image

2 participants