fix(tui): apply terminal backend config before launch - #42656
Merged
teknium1 merged 1 commit intoJun 9, 2026
Conversation
helix4u
marked this pull request as ready for review
June 9, 2026 07:10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fixes a terminal backend config bridge gap in native TUI/dashboard chat launch paths.
The terminal tool reads backend settings from env vars such as
TERMINAL_ENV, butterminal.backendlives inconfig.yaml. Classic CLI startup importscli.py, which bridges that config into env before tools run. The native TUI and dashboard embedded chat paths spawn child processes before/bypassing that bridge, so a config liketerminal.backend: dockercould appear in debug/config output while the actual terminal tool still created a local environment.This adds a small shared bridge in
hermes_cli.config, reuses it whenhermes config set terminal.*syncs.env, and applies it to the native TUI/dashboard child env before launch.Related Issue
N/A - support-thread fix. Checked related upstream PRs #25412, #13651, #28888, and closed #14079; none cover this TUI/dashboard child-launch backend propagation gap.
Type of Change
Changes Made
apply_terminal_config_to_env()andterminal_config_env_var_for_key()inhermes_cli/config.pyso terminal config-to-env behavior has a shared path.hermes_cli/main.pyTUI launch to hydrate terminal env vars from config before spawning the TUI process.hermes_cli/web_server.pydashboard embedded chat launch to hydrate terminal env vars from config before spawning the PTY process.terminal.backend: docker.How to Test
terminal.backend: dockerinconfig.yamland leaveTERMINAL_ENVunset/stale in the parent process.TERMINAL_ENV=dockerbefore terminal tools initialize, so terminal calls use the configured Docker-compatible backend instead of falling back to local.Local validation run:
python -m py_compile hermes_cli/config.py hermes_cli/main.py hermes_cli/web_server.pygit diff --check -- hermes_cli/config.py hermes_cli/main.py hermes_cli/web_server.py tests/hermes_cli/test_tui_resume_flow.py tests/hermes_cli/test_web_server.pyscripts/run_tests.sh -j 4 tests/hermes_cli/test_tui_resume_flow.py tests/hermes_cli/test_web_server.py-> 304 passedChecklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AFor New Skills
N/A
Screenshots / Logs
N/A
Infographic