Skip to content

fix(tui): drop /quit alias 'q' so /q routes to backend /queue#31985

Closed
hclsys wants to merge 1 commit into
NousResearch:mainfrom
hclsys:fix/tui-q-alias-collision-quit-queue-31983
Closed

fix(tui): drop /quit alias 'q' so /q routes to backend /queue#31985
hclsys wants to merge 1 commit into
NousResearch:mainfrom
hclsys:fix/tui-q-alias-collision-quit-queue-31983

Conversation

@hclsys

@hclsys hclsys commented May 25, 2026

Copy link
Copy Markdown

Fixes #31983.

Summary

In the TUI, typing /q exited Hermes instead of queuing a prompt. The quit command carried alias q (ui-tui/src/app/slash/commands/core.ts), which collides with the Python-side /queue alias q (hermes_cli/commands.py). TUI-local commands dispatch before the backend, so /q always resolved to /quitctx.session.die().

Fix

Remove q from the quit aliases (now just ['exit']). /quit and /exit are explicit enough for exiting, so /q falls through to the backend where it correctly maps to /queue.

Test

Added a regression test to src/__tests__/slashParity.test.ts asserting q is not a TUI-local name/alias (so it can't shadow the backend /queue). The existing parity suite only deduped an alias set, so this collision was previously silent.

$ cd ui-tui && npm run build --prefix packages/hermes-ink && ./node_modules/.bin/vitest run src/__tests__/slashParity.test.ts
 Test Files  1 passed (1)
      Tests  3 passed (3)

Verified the test guards the regression: with the q alias restored, the new test fails (1 failed); with the fix, it passes.

Note: npm run type-check reports pre-existing errors in packages/hermes-ink/src/utils/execFileNoThrow.ts and src/app/useMainApp.ts that are present on main independent of this change (confirmed by stashing the diff); this PR touches only the quit alias array and the parity test, both of which lint clean.

The TUI 'quit' command carried alias 'q', which collides with the
Python-side /queue alias (hermes_cli/commands.py). TUI-local commands
dispatch before the backend, so typing /q exited Hermes (session.die)
instead of queueing a prompt for the next turn.

Remove 'q' from the quit aliases — /quit and /exit are explicit enough —
so /q falls through to the backend where it maps to /queue. Add a
slash-parity regression test asserting 'q' is not a TUI-local name/alias.

Fixes NousResearch#31983
@alt-glitch alt-glitch added type/bug Something isn't working comp/tui Terminal UI (ui-tui/ + tui_gateway/) P2 Medium — degraded but workaround exists duplicate This issue or pull request already exists labels May 25, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of PR #14681 which makes the same change (remove q from quit aliases in core.ts). #14681 has been open since April and is the canonical fix for this alias collision.

@hclsys

hclsys commented May 25, 2026

Copy link
Copy Markdown
Author

Closing in favor of #14681 by @8bit64k, which makes the same q-alias removal and has been open since April (and goes further by also registering /queue as a TUI-local command). Theirs is the canonical fix — I missed it in my dup-scan since it predates the issue #31983 by a month. One thing from here that might be worth folding into #14681 if useful: I added a slash-parity regression test (expect(LOCAL_COMMAND_NAMES.has('q')).toBe(false)) that fails-without / passes-with the alias removal, since the existing parity suite deduped the alias set and so never caught this collision. Happy to PR just that test against #14681's branch or separately if a maintainer wants it. Thanks @8bit64k.

@hclsys hclsys closed this May 25, 2026
daimon-nous Bot pushed a commit that referenced this pull request May 25, 2026
Adapted from @hclsys's test in PR #31985. Asserts findSlashCommand('q')
resolves to the queue command, not quit.
daletkc pushed a commit to daletkc/hermes-agent that referenced this pull request May 25, 2026
…rch#31983)

Adapted from @hclsys's test in PR NousResearch#31985. Asserts findSlashCommand('q')
resolves to the queue command, not quit.
bridge25 pushed a commit to bridge25/hermes-agent that referenced this pull request May 27, 2026
…rch#31983)

Adapted from @hclsys's test in PR NousResearch#31985. Asserts findSlashCommand('q')
resolves to the queue command, not quit.
mathias3 pushed a commit to mathias3/hermes-agent that referenced this pull request May 28, 2026
…rch#31983)

Adapted from @hclsys's test in PR NousResearch#31985. Asserts findSlashCommand('q')
resolves to the queue command, not quit.
Bryce-huang pushed a commit to wbkunlun/hermes-agent that referenced this pull request May 29, 2026
…rch#31983)

Adapted from @hclsys's test in PR NousResearch#31985. Asserts findSlashCommand('q')
resolves to the queue command, not quit.

#AI commit#
mosaiq-systems pushed a commit to mosaiq-systems/hermes-agent that referenced this pull request May 29, 2026
…rch#31983)

Adapted from @hclsys's test in PR NousResearch#31985. Asserts findSlashCommand('q')
resolves to the queue command, not quit.
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
…rch#31983)

Adapted from @hclsys's test in PR NousResearch#31985. Asserts findSlashCommand('q')
resolves to the queue command, not quit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/tui Terminal UI (ui-tui/ + tui_gateway/) duplicate This issue or pull request already exists 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.

TUI: /q alias resolves to /quit instead of /queue

2 participants