fix(tui): route mutating slash commands through live gateway state#16656
Conversation
Route /browser, /reload-mcp, /rollback, /stop, /fast, and /busy through direct TUI RPC handlers so state changes hit the live gateway session instead of slash-worker fallback. Add TUI session finalize/reset parity hooks (memory commit + plugin boundaries) and parity matrix tests to keep mutating commands off fallback.
Run ui-tui lint autofix + prettier and commit the resulting formatting-only changes for the parity PR branch.
There was a problem hiding this comment.
Pull request overview
Routes mutating TUI slash commands through live gateway RPCs (instead of slash-worker fallback) and adds gateway session lifecycle parity hooks, with accompanying parity-focused tests.
Changes:
- Added native TUI handlers for
/browser,/reload-mcp,/rollback,/stop,/fast, and/busythat call gateway RPCs directly. - Added TUI gateway session lifecycle parity hooks (memory commit +
on_session_finalize/on_session_reset) and shutdown finalization. - Added tests covering slash route parity and new gateway config/session-lifecycle behaviors.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| ui-tui/src/gatewayTypes.ts | Expands/adjusts RPC response typings for new native routes (reload/stop/browser/rollback). |
| ui-tui/src/app/slash/commands/session.ts | Implements native /fast and /busy commands via config.get/config.set RPCs. |
| ui-tui/src/app/slash/commands/ops.ts | Implements native /stop, /reload-mcp, /browser, and /rollback commands via gateway RPCs. |
| ui-tui/src/tests/slashParity.test.ts | Adds a command-route parity matrix to prevent mutating commands from falling back to slash-worker. |
| ui-tui/src/tests/createSlashHandler.test.ts | Adds focused tests ensuring new native commands bypass slash.exec and route via RPC. |
| tui_gateway/server.py | Adds session boundary hooks + finalization, plus new config keys (fast, busy) and shutdown behavior. |
| tests/test_tui_gateway_server.py | Adds tests for session finalization/reset hooks and new config behaviors (fast, busy). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Harden busy mode config reads against invalid display config shapes and align /fast help+usage text with accepted aliases, with regression coverage for non-dict display values.
|
Addressed Copilot review feedback in a13449a:\n- hardened busy mode config reads for non-dict display config values\n- aligned /fast help + usage text with accepted aliases\n- added regression coverage for config.get busy with non-dict display |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Make `config.set fast status` read-only and keep live agent request overrides in sync with fast-mode toggles so runtime API kwargs match the selected mode.
|
Addressed the latest Copilot fast-mode notes in b8556eb:
|
Resolve session command merge conflict and keep the branch current with main so PR #16656 is mergeable.
Match classic CLI parity by refusing to enable fast mode when the active model cannot produce fast request overrides, avoiding a misleading fast status with no runtime effect.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Distinguish missing model from unsupported model before enabling fast mode and cover both cases so config and live agent state remain untouched on invalid fast toggles.
|
Addressed the latest Copilot fast-mode support validation notes in 4f59510:
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Load slash command names from the Python registry instead of regex-parsing source, and guard native rollback when no TUI session is active.
|
Addressed the latest Copilot review in 8a33ed6:
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Keep the parity test backed by the real Python command registry while avoiding hard failures in Node-only Vitest environments that cannot import hermes_cli.commands.
|
Addressed the latest Copilot slash parity robustness note in ed4f7f0:
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Resolve session command merge conflict and keep the branch current with main so PR NousResearch#16656 is mergeable.
…-mutating-commands fix(tui): route mutating slash commands through live gateway state
Resolve session command merge conflict and keep the branch current with main so PR NousResearch#16656 is mergeable.
…-mutating-commands fix(tui): route mutating slash commands through live gateway state
Resolve session command merge conflict and keep the branch current with main so PR NousResearch#16656 is mergeable.
…-mutating-commands fix(tui): route mutating slash commands through live gateway state
Resolve session command merge conflict and keep the branch current with main so PR NousResearch#16656 is mergeable.
…-mutating-commands fix(tui): route mutating slash commands through live gateway state
Resolve session command merge conflict and keep the branch current with main so PR NousResearch#16656 is mergeable.
…-mutating-commands fix(tui): route mutating slash commands through live gateway state
Summary
/browser,/reload-mcp,/rollback,/stop,/fast, and/busyso mutating operations hit live gateway RPCs instead of slash-worker fallbacktui_gateway/server.pyto commit memory and fireon_session_finalize/on_session_reseton close/new/resume boundariesTest plan
npm run type-check(inui-tui/)npm run build --prefix packages/hermes-ink && npm test -- --run src/__tests__/createSlashHandler.test.ts src/__tests__/slashParity.test.ts(inui-tui/)scripts/run_tests.sh tests/test_tui_gateway_server.py -q