hermes - 💡(How to fix) Fix TUI: /reset and /new get swallowed by slash autocomplete on Enter instead of executing

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

In the TUI, typing /reset (and also /new) followed by Enter does not execute the slash command. Instead, Enter appears to accept slash autocomplete / help expansion, leaving the user stuck in what looks like a frozen screen or dead-end prompt flow. The destructive confirmation modal for starting a new session is never reached in the failing path.

Root Cause

Likely root cause

This looks like a regression in TUI submit behavior when slash completions are present.

Fix Action

Fix / Workaround

Because Enter prioritizes applying the active completion whenever composerState.completions.length is non-zero, slash commands like /reset and /new never reach dispatchSubmission() on first Enter if the completion layer is active.

And so the actual slash command handler in core.ts never runs:

{
  aliases: ['new'],
  help: 'start a new session',
  name: 'clear',
  run: (arg, ctx, cmd) => {
    ...
    patchOverlayState({
      confirm: {
        ...
        onConfirm: commit,
        title: isNew ? 'Start a new session?' : 'Clear the current session?'
      }
    })
  }
}

Code Example

const submit = useCallback(
  (value: string) => {
    if (composerState.completions.length) {
      const row = composerState.completions[composerState.compIdx]

      if (row?.text) {
        const text = value.startsWith('/') && row.text.startsWith('/') ? row.text.slice(1) : row.text
        const next = value.slice(0, composerState.compReplace) + text

        if (next !== value) {
          return composerActions.setInput(next)
        }
      }
    }
    ...

---

if (looksLikeSlashCommand(full)) {
  appendMessage({ kind: 'slash', role: 'system', text: full })
  composerActions.pushHistory(full)
  slashRef.current(full)
  composerActions.clearIn()
  return
}

---

{
  aliases: ['new'],
  help: 'start a new session',
  name: 'clear',
  run: (arg, ctx, cmd) => {
    ...
    patchOverlayState({
      confirm: {
        ...
        onConfirm: commit,
        title: isNew ? 'Start a new session?' : 'Clear the current session?'
      }
    })
  }
}

---

-      if (value.startsWith('/') && composerState.completions.length) {
+      if (composerState.completions.length) {
RAW_BUFFERClick to expand / collapse

Summary

In the TUI, typing /reset (and also /new) followed by Enter does not execute the slash command. Instead, Enter appears to accept slash autocomplete / help expansion, leaving the user stuck in what looks like a frozen screen or dead-end prompt flow. The destructive confirmation modal for starting a new session is never reached in the failing path.

Reproduction

Environment:

  • Hermes Agent v0.13.0 (2026.5.7)
  • Repo checkout clean and aligned with origin/main
  • Host: macOS
  • Reproduced in hermes --tui
  • Also reproduced with HERMES_TUI_INLINE=1 hermes --tui

Steps:

  1. Start hermes --tui
  2. Wait for the TUI to become ready
  3. Type /reset
  4. Press Enter

Actual result:

  • TUI renders a help/completion box for /reset:
    • /reset Start a new session (fresh session ID + history) (alias for /new)
  • The command is not executed
  • The session is not reset
  • The destructive confirmation flow is not reached
  • From the user perspective the screen appears stuck/frozen after the prompt appears

Expected result:

  • /reset should execute the same destructive command flow as /new
  • It should open the confirm modal (Start a new session?) or directly commit if no-confirm mode is enabled
  • After confirming, the session should reset normally

Additional confirmation

I reproduced the same problem with /new, which suggests this is not specific to the alias resolution for /reset.

Likely root cause

This looks like a regression in TUI submit behavior when slash completions are present.

Relevant code:

  • ui-tui/src/app/useSubmission.ts
  • ui-tui/src/app/slash/commands/core.ts

Current submit path in useSubmission.ts:

const submit = useCallback(
  (value: string) => {
    if (composerState.completions.length) {
      const row = composerState.completions[composerState.compIdx]

      if (row?.text) {
        const text = value.startsWith('/') && row.text.startsWith('/') ? row.text.slice(1) : row.text
        const next = value.slice(0, composerState.compReplace) + text

        if (next !== value) {
          return composerActions.setInput(next)
        }
      }
    }
    ...

Because Enter prioritizes applying the active completion whenever composerState.completions.length is non-zero, slash commands like /reset and /new never reach dispatchSubmission() on first Enter if the completion layer is active.

That means this path is never reached:

if (looksLikeSlashCommand(full)) {
  appendMessage({ kind: 'slash', role: 'system', text: full })
  composerActions.pushHistory(full)
  slashRef.current(full)
  composerActions.clearIn()
  return
}

And so the actual slash command handler in core.ts never runs:

{
  aliases: ['new'],
  help: 'start a new session',
  name: 'clear',
  run: (arg, ctx, cmd) => {
    ...
    patchOverlayState({
      confirm: {
        ...
        onConfirm: commit,
        title: isNew ? 'Start a new session?' : 'Clear the current session?'
      }
    })
  }
}

Suspected regressing commit

4b0686f63d1d50b1b603af05235f0c21be63ad77

Commit message: fix(tui): apply path/@ completion on Enter

The diff broadened Enter-to-apply-completion from slash-only to any active completion:

-      if (value.startsWith('/') && composerState.completions.length) {
+      if (composerState.completions.length) {

This makes sense for @file, ./path, ~/path, etc., but it appears to have broken the normal Enter-to-run behavior for slash commands when the command is already fully typed.

Observations

  • git status is clean for the relevant files
  • git diff origin/main -- ... is empty
  • So this does not appear to come from local modifications by another model; it reproduces on upstream clean main

Possible fix directions

Any of these may work:

  1. For slash commands, if the completion candidate resolves to the exact same command text (or the input is already a complete slash command), let Enter submit instead of only applying completion
  2. Restrict Enter-to-apply-completion behavior so slash commands keep the old submit semantics once stable/full
  3. Require Tab for explicit completion acceptance on slash commands, while Enter submits

User impact

This makes /reset feel broken in the TUI and can look like a hard UI freeze because the user gets trapped in a non-progressing overlay/help state exactly when trying to recover/reset the session.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix TUI: /reset and /new get swallowed by slash autocomplete on Enter instead of executing