fix: register shell hooks in TUI gateway - #34112
Open
orcool wants to merge 1 commit into
Open
Conversation
Collaborator
Contributor
Author
|
Thanks for pointing these out. Agreed — this addresses the same TUI gateway registration gap. The main difference in this PR is that it keeps the fix narrow while registering both Python plugins and declarative shell hooks in the actual Two related notes from local validation:
HERMES_HOME="$HOME/.hermes/profiles/mobile-apps" cmux hooks hermes-agent install --yes
Happy to close this in favor of whichever existing PR maintainers prefer, or adjust this PR if a narrower/superset direction is preferred. |
This was referenced Jun 28, 2026
15 tasks
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.
Summary
Register declarative shell hooks inside the TUI gateway subprocess.
The outer
hermes --tuilauncher and the actual TUI gateway are separate Python processes. Agent turns in the TUI are handled bypython -m tui_gateway.entry, so conversation hooks such aspost_llm_callneed to be registered in that process as well.Before this change,
hermes hooks test post_llm_callcould succeed while real TUI responses did not fire the same hook, because the test command registered hooks in its own process but the TUI gateway hook manager remained empty.Why
This fixes a TUI-specific process-boundary bug:
tui_gateway.entry.post_llm_calland similar lifecycle hooks do not fire after real TUI responses.One visible symptom is that the existing cmux integration hook:
can work under
hermes hooks test post_llm_callbut fail to run after an actual TUI assistant response.Changes
_prepare_tui_gateway_hooks()totui_gateway/entry.py.gateway.ready.Test Plan
./venv/bin/python -m py_compile tui_gateway/entry.py./venv/bin/python -m pytest tests/test_tui_gateway_entry_hooks.py tests/agent/test_shell_hooks.py tests/agent/test_shell_hooks_consent.py -q -o 'addopts='post_llm_callnow fires after real TUI assistant responses once the TUI is restarted.