Fix desktop IME enter handling and gateway restart guards - #37603
Open
nickytod wants to merge 1 commit into
Open
Fix desktop IME enter handling and gateway restart guards#37603nickytod wants to merge 1 commit into
nickytod wants to merge 1 commit into
Conversation
19 tasks
This was referenced Jun 3, 2026
19 tasks
teknium1
reviewed
Jul 13, 2026
teknium1
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the multi-surface fix. Current main already covers the primary composer and gateway-restart reports, but this branch still contains useful desktop sibling-path coverage.
Problems
hermes_cli/gateway.py:2381and:2416changeKillModeaway from the current remediation. Current main intentionally retainsKillMode=mixedinhermes_cli/gateway.py:2764/:2798and reaps orphans throughExecStopPostplusgateway/cgroup_cleanup.py:1-12(commite551da6ddb39a712c93e6c48a16aa748e2c7bc95).- The raw-restart approval guard is now redundant:
tools/terminal_tool.py:2250-2271blocks lifecycle commands before approval or execution, includingforce=True(commit245b95b09470bb3887943122a7d0de5bf20da055). - Two desktop files changed here no longer exist on main. The live edit composer is now
apps/desktop/src/components/assistant-ui/thread/user-edit-composer.tsx; its Enter paths at :545 and :573 remain unguarded. Current rename and onboarding Enter handlers are likewise unguarded atsession-actions-menu.tsx:329-336,onboarding/flow.tsx:82-88, andonboarding/index.tsx:642-664.
Suggested changes
- Salvage the remaining IME guards and tests onto those current desktop paths, while dropping the superseded gateway/systemd portions.
Automated hermes-sweeper review.
| @@ -2381,7 +2381,7 @@ def generate_systemd_unit(system: bool = False, run_as_user: str | None = None) | |||
| RestartMaxDelaySec=300 | |||
Contributor
There was a problem hiding this comment.
Please do not change this to KillMode=control-group. Current main intentionally preserves KillMode=mixed and adds ExecStopPost=-...gateway.cgroup_cleanup to reap orphaned per-PID processes after shutdown; see hermes_cli/gateway.py:2764-2768 and gateway/cgroup_cleanup.py:1-12 (commit e551da6ddb39a712c93e6c48a16aa748e2c7bc95).
This was referenced Jul 28, 2026
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
systemctl stop/restartofhermes-gatewayservices from inside gateway sessions, even with yolo or approvals off.KillMode=control-groupand assert that generated units no longer useKillMode=mixed.Fixes #37483
Fixes #37453
Fixes #37454
Verification
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 /opt/homebrew/bin/python3.11 -m pytest tests/tools/test_approval.py::TestGatewaySystemctlRestartGuard tests/hermes_cli/test_gateway_service.py::TestGeneratedSystemdUnits::test_user_unit_avoids_recursive_execstop_and_uses_extended_stop_timeout tests/hermes_cli/test_gateway_service.py::TestGeneratedSystemdUnits::test_system_unit_avoids_recursive_execstop_and_uses_extended_stop_timeout -q -o 'addopts='npm run type-check --workspace apps/desktopnpm run test:ui --workspace apps/desktop -- src/lib/ime.test.tsnpx eslint src/app/chat/composer/index.tsx src/components/assistant-ui/thread.tsx src/app/chat/sidebar/session-actions-menu.tsx src/components/desktop-onboarding-overlay.tsx src/lib/ime.ts src/lib/ime.test.ts