Skip to content

fix(tui): route mutating slash commands through live gateway state#16656

Merged
OutThisLife merged 9 commits into
mainfrom
bb/tui-parity-mutating-commands
Apr 27, 2026
Merged

fix(tui): route mutating slash commands through live gateway state#16656
OutThisLife merged 9 commits into
mainfrom
bb/tui-parity-mutating-commands

Conversation

@OutThisLife

Copy link
Copy Markdown
Collaborator

Summary

  • add native TUI slash handlers for /browser, /reload-mcp, /rollback, /stop, /fast, and /busy so mutating operations hit live gateway RPCs instead of slash-worker fallback
  • add TUI session lifecycle parity hooks in tui_gateway/server.py to commit memory and fire on_session_finalize / on_session_reset on close/new/resume boundaries
  • add parity coverage: command-route matrix test over command registry entries plus focused slash and gateway tests for new native routes and config/session lifecycle behavior

Test plan

  • npm run type-check (in ui-tui/)
  • npm run build --prefix packages/hermes-ink && npm test -- --run src/__tests__/createSlashHandler.test.ts src/__tests__/slashParity.test.ts (in ui-tui/)
  • scripts/run_tests.sh tests/test_tui_gateway_server.py -q

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 /busy that 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.

Comment thread tui_gateway/server.py Outdated
Comment thread ui-tui/src/app/slash/commands/session.ts Outdated
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.
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/tui Terminal UI (ui-tui/ + tui_gateway/) comp/gateway Gateway runner, session dispatch, delivery labels Apr 27, 2026
@OutThisLife

Copy link
Copy Markdown
Collaborator Author

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread tui_gateway/server.py
Comment thread tui_gateway/server.py Outdated
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.
@OutThisLife

Copy link
Copy Markdown
Collaborator Author

Addressed the latest Copilot fast-mode notes in b8556eb:

  • config.set fast now treats status as read-only (no config write / no live mutation)
  • live session fast toggles now sync agent.request_overrides from resolve_fast_mode_overrides(agent.model) and clear fast-related override keys when returning to normal
  • added regression coverage for status non-mutation and request-overrides sync behavior

@OutThisLife OutThisLife requested a review from Copilot April 27, 2026 17:49
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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread tui_gateway/server.py Outdated
Comment thread tests/test_tui_gateway_server.py
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.
@OutThisLife

Copy link
Copy Markdown
Collaborator Author

Addressed the latest Copilot fast-mode support validation notes in 4f59510:

  • added an explicit missing-model guard before resolving fast-mode overrides
  • changed unsupported-model detection to overrides is None
  • added missing-model regression coverage alongside unsupported-model coverage

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread ui-tui/src/__tests__/slashParity.test.ts Outdated
Comment thread ui-tui/src/app/slash/commands/ops.ts
Load slash command names from the Python registry instead of regex-parsing source, and guard native rollback when no TUI session is active.
@OutThisLife

Copy link
Copy Markdown
Collaborator Author

Addressed the latest Copilot review in 8a33ed6:

  • slashParity.test.ts now loads canonical command names from Python's actual COMMAND_REGISTRY instead of regex-parsing commands.py
  • /rollback now returns a friendly local message when no TUI session is active instead of making a guaranteed-failing RPC
  • added rollback tests for both active-session native RPC routing and no-session guard behavior

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread ui-tui/src/__tests__/slashParity.test.ts Outdated
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.
@OutThisLife

Copy link
Copy Markdown
Collaborator Author

Addressed the latest Copilot slash parity robustness note in ed4f7f0:

  • the test still reads the real Python COMMAND_REGISTRY
  • if Python or hermes_cli.commands is unavailable in a Node-only Vitest environment, the parity tests now skip with an explicit reason instead of hard-failing the run

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@OutThisLife OutThisLife merged commit e80504b into main Apr 27, 2026
15 of 16 checks passed
@OutThisLife OutThisLife deleted the bb/tui-parity-mutating-commands branch April 27, 2026 18:30
ulasbilgen pushed a commit to ulasbilgen/hermes-adhd-agent that referenced this pull request May 1, 2026
Resolve session command merge conflict and keep the branch current with main so PR NousResearch#16656 is mergeable.
ulasbilgen pushed a commit to ulasbilgen/hermes-adhd-agent that referenced this pull request May 1, 2026
…-mutating-commands

fix(tui): route mutating slash commands through live gateway state
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
Resolve session command merge conflict and keep the branch current with main so PR NousResearch#16656 is mergeable.
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
…-mutating-commands

fix(tui): route mutating slash commands through live gateway state
dannyJ848 pushed a commit to dannyJ848/hermes-agent that referenced this pull request May 17, 2026
Resolve session command merge conflict and keep the branch current with main so PR NousResearch#16656 is mergeable.
dannyJ848 pushed a commit to dannyJ848/hermes-agent that referenced this pull request May 17, 2026
…-mutating-commands

fix(tui): route mutating slash commands through live gateway state
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
Resolve session command merge conflict and keep the branch current with main so PR NousResearch#16656 is mergeable.
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
…-mutating-commands

fix(tui): route mutating slash commands through live gateway state
Egavasyug pushed a commit to Egavasyug/hermes-agent that referenced this pull request Jun 10, 2026
Resolve session command merge conflict and keep the branch current with main so PR NousResearch#16656 is mergeable.
Egavasyug pushed a commit to Egavasyug/hermes-agent that referenced this pull request Jun 10, 2026
…-mutating-commands

fix(tui): route mutating slash commands through live gateway state
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery comp/tui Terminal UI (ui-tui/ + tui_gateway/) P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants