hermes-agent/ui-tui/src/app
0xbyt4 98418afd5d fix(tui): break TTS→STT feedback loop + colorize REC badge
TTS feedback loop (hermes_cli/voice.py)

The VAD loop kept the microphone live while speak_text played the
agent's reply over the speakers, so the reply itself was picked up,
transcribed, and submitted — the agent then replied to its own echo
("Ha, looks like we're in a loop").

Ported cli.py:_voice_tts_done synchronisation:

- _tts_playing: threading.Event (initially set = "not playing").
- speak_text cancels the active recorder before opening the speakers,
  clears _tts_playing, and on exit waits 300 ms before re-starting the
  recorder — long enough for the OS audio device to settle so afplay
  and sounddevice don't race for it.
- _continuous_on_silence now waits on _tts_playing (up to 60 s) before
  re-arming the mic with another 300 ms gap, mirroring
  cli.py:10619-10621.  If the user flips voice off during the wait the
  loop exits cleanly instead of fighting for the device.

Without both halves the loop races: if the silence callback fires
before TTS starts it re-arms immediately; if TTS is already playing
the pause-and-resume path catches it.

Red REC badge (ui-tui appChrome + useMainApp)

Classic CLI (cli.py:_get_voice_status_fragments) renders "● REC" in
red and "◉ STT" in amber.  TUI was showing a dim "REC" with no dot,
making it hard to spot at a glance.  voiceLabel now emits the same
glyphs and appChrome colours them via t.color.error / t.color.warn,
falling back to dim for the idle label.
2026-04-23 16:18:15 -07:00
..
slash feat(tui): match CLI's voice slash + VAD-continuous recording model 2026-04-23 16:18:15 -07:00
createGatewayEventHandler.ts fix(tui): voice TTS speak-back + transcript-key bug + auto-submit 2026-04-23 16:18:15 -07:00
createSlashHandler.ts feat(tui): replace /clear double-press gate with a proper confirm overlay 2026-04-18 18:04:08 -05:00
delegationStore.ts feat(tui): subagent spawn observability overlay 2026-04-22 10:38:17 -05:00
gatewayContext.tsx feat: add inline token count etc and fix venv 2026-04-15 10:20:56 -05:00
inputSelectionStore.ts fix(tui): Ctrl+C with input selection actually preserves input (lift handler to app level) 2026-04-18 16:28:51 -05:00
interfaces.ts feat(tui): match CLI's voice slash + VAD-continuous recording model 2026-04-23 16:18:15 -07:00
overlayStore.ts feat(tui): subagent spawn observability overlay 2026-04-22 10:38:17 -05:00
setupHandoff.ts feat(tui): /model and /setup slash commands with in-place CLI handoff 2026-04-17 10:58:18 -05:00
spawnHistoryStore.ts feat(tui): subagent spawn observability overlay 2026-04-22 10:38:17 -05:00
turnController.ts chore: uptick 2026-04-22 11:32:17 -05:00
turnStore.ts feat(tui): interleave tool rows into live assistant turns 2026-04-17 11:33:29 -05:00
uiStore.ts fix(tui): /statusbar top = inline above input, not row 0 of the screen 2026-04-22 15:27:54 -05:00
useComposerState.ts fix(tui): preserve prior segment output on Ctrl+C interrupt 2026-04-21 14:48:50 -05:00
useConfigSync.ts style(debug): add missing blank line between LogSnapshot and helpers 2026-04-22 16:34:05 -05:00
useInputHandlers.ts feat(tui): match CLI's voice slash + VAD-continuous recording model 2026-04-23 16:18:15 -07:00
useLongRunToolCharms.ts refactor(tui): /clean pass across ui-tui — 49 files, −217 LOC 2026-04-16 22:32:53 -05:00
useMainApp.ts fix(tui): break TTS→STT feedback loop + colorize REC badge 2026-04-23 16:18:15 -07:00
useSessionLifecycle.ts refactor(tui): turn elapsed lives in FaceTicker; emit done-in sys line 2026-04-20 11:38:11 -05:00
useSubmission.ts fix(tui): apply path/@ completion on Enter 2026-04-21 14:30:45 -05:00