hermes-agent/ui-tui/src
xxxigm 58ad6942d9
fix(tui): don't make Enter swallow trailing-space-only slash completions (#48425)
* fix(tui): don't make Enter swallow trailing-space-only slash completions

Submitting a slash command in the TUI took three Enter presses: one to
complete the name (/ex → /exit), a second that only appended the trailing
space the gateway adds to keep the classic-CLI prompt_toolkit dropdown open
(/exit → "/exit "), and a third to actually submit.

The composer's submit handler accepted the highlighted completion whenever
applying it changed the input at all, so the whitespace-only delta ate an
extra keypress. Treat a completion whose only change is trailing whitespace
on an already-complete token as "already complete" and fall through to
submit. Partial-name and argument completions (a real token change) still
accept on Enter as before.

The replace/accept logic is extracted into pure helpers (applyCompletion,
completionToApplyOnSubmit) in domain/slash.ts.

* test(tui): cover Enter/completion trailing-space behavior and isolate poller queue

- completionApply.test.ts asserts completionToApplyOnSubmit accepts real
  token completions (partial command name, argument) but returns null for a
  trailing-space-only delta on an already-complete command, so Enter submits
  instead of needing extra presses.
- test_notification_poller_delivers_completion / _skips_consumed previously
  shared the process-global process_registry.completion_queue. Their events
  carry no session_key, so a leaked/concurrent poller could dequeue and
  dispatch them to a fixture agent without run_conversation, flaking CI
  ("AttributeError: '_FakeAgent' object has no attribute 'run_conversation'").
  Isolate the queue per test (fresh queue.Queue via monkeypatch), matching the
  sibling poller tests that already do this.
2026-06-18 11:04:59 -05:00
..
__tests__ fix(tui): don't make Enter swallow trailing-space-only slash completions (#48425) 2026-06-18 11:04:59 -05:00
app fix(tui): don't make Enter swallow trailing-space-only slash completions (#48425) 2026-06-18 11:04:59 -05:00
components fix(tui): MCP headline counts connected servers, not disabled ones (#48402) 2026-06-18 05:41:19 -07:00
config feat(credits): usage-aware credits — in-session notices, /usage view, dev readout (#40011) 2026-06-06 13:18:18 +05:30
content feat: add TUI session orchestrator 2026-05-26 20:51:59 -07:00
domain fix(tui): don't make Enter swallow trailing-space-only slash completions (#48425) 2026-06-18 11:04:59 -05:00
hooks fix(tui): recompute virtual tail after width resize 2026-05-23 14:49:26 -05:00
lib change(tooling): typecheck in CI, update ts to 6 2026-06-10 11:59:34 -04:00
protocol refactor(tui): /clean pass across ui-tui — 49 files, −217 LOC 2026-04-16 22:32:53 -05:00
types fix(tui): keep Ink displayCursor in sync with fast-echo writes so cursor stops drifting (#26717) 2026-05-16 00:28:12 -05:00
app.tsx fix(tui): apply ui-tui fix pass and restore type-check 2026-04-25 14:08:54 -05:00
banner.ts feat(tui): responsive banner tiers 2026-05-23 17:37:51 -05:00
entry.tsx fix(tui): install the process.on('exit') terminal-mode backstop (#42165) 2026-06-08 08:21:19 -07:00
gatewayClient.ts fix(ui-tui): stabilize embedded dashboard chat gateway (#44528) 2026-06-11 19:47:53 -04:00
gatewayTypes.ts feat(billing): /credits command — balance + portal top-up handoff (#44776) 2026-06-12 08:51:10 +00:00
theme.ts fix(tui): honor skin highlight colors (#20895) 2026-05-06 14:01:56 -07:00
types.ts chore(approval): tighten allow_permanent comments + DRY the no-always opt set 2026-06-11 18:42:59 -05:00