hermes-agent/ui-tui/src/lib
Teknium d87fd9f039
fix(goals): make /goal work in TUI and fix gateway verdict delivery (#19209)
/goal was silently broken outside the classic CLI.

TUI: /goal was routed through the HermesCLI slash-worker subprocess,
which set the goal row in SessionDB but then called
_pending_input.put(state.goal) — the subprocess has no reader for that
queue, so the kickoff message was discarded. No post-turn judge was
wired into prompt.submit either, so even a manual kickoff would not
continue the goal loop. Intercept /goal in command.dispatch instead,
drive GoalManager directly, and return {type: send, notice, message}
so the TUI client renders the Goal-set notice and fires the kickoff.
Run the judge in _run_prompt_submit after message.complete, surface
the verdict via status.update {kind: goal}, and chain the continuation
turn after the running guard is released.

Gateway: _post_turn_goal_continuation was gated on
hasattr(adapter, 'send_message'), but adapters only expose send().
That branch was dead on every platform — users never saw
'✓ Goal achieved', 'Continuing toward goal', or budget-exhausted
messages. Replace the dead call with adapter.send(chat_id, content,
metadata) and drop a broken reference to self._loop.

Tests:
- tests/tui_gateway/test_goal_command.py — full /goal dispatch matrix
  (set / status / pause / resume / clear / stop / done / whitespace)
  plus regressions for slash.exec → 4018 and 'goal' staying in
  _PENDING_INPUT_COMMANDS.
- tests/gateway/test_goal_verdict_send.py — locks in the adapter.send
  path for done / continue / budget-exhausted and verifies the hook
  no-ops when no goal is set or the adapter lacks send().
2026-05-03 05:49:12 -07:00
..
circularBuffer.ts fix(tui): address PR #13231 review comments 2026-04-20 19:09:09 -05:00
clipboard.ts fix(tui): raise picker selection contrast with inverse + bold 2026-04-21 14:31:21 -05:00
editor.test.ts fix(tui): address Copilot review on editor handoff 2026-04-25 20:34:24 -05:00
editor.ts fix(tui): address Copilot review on editor handoff 2026-04-25 20:34:24 -05:00
emoji.ts fix(tui): inject VS16 so text-default emoji render as color glyphs 2026-04-21 15:52:39 -05:00
externalCli.ts feat(tui): /model and /setup slash commands with in-place CLI handoff 2026-04-17 10:58:18 -05:00
forceTruecolor.ts fix(tui): normalize legacy Terminal.app colors (#17695) 2026-04-29 20:13:49 -07:00
fpsStore.ts chore(tui): /clean recent perf work — KISS/DRY pass 2026-04-26 20:38:47 -05:00
gracefulExit.ts refactor(tui): /clean pass on memory + resize helpers 2026-04-20 18:58:44 -05:00
history.ts refactor(tui): /clean pass across ui-tui — 49 files, −217 LOC 2026-04-16 22:32:53 -05:00
inputMetrics.ts fix(tui): word-wrap composer input (#17651) 2026-04-29 16:55:49 -07:00
liveProgress.test.ts chore(tui): /clean recent perf work — KISS/DRY pass 2026-04-26 20:38:47 -05:00
liveProgress.ts chore(tui): /clean recent perf work — KISS/DRY pass 2026-04-26 20:38:47 -05:00
mathUnicode.ts docs: clarify wrapForFrac and streaming math-fence rationale 2026-04-28 21:43:32 -04:00
memory.ts fix(tui): address PR #13231 review comments 2026-04-20 19:09:09 -05:00
memoryMonitor.ts chore(salvage): strip duplicated/merge-corrupted blocks from PR #17664 2026-04-29 21:56:51 -07:00
messages.test.ts fix(tui): stabilize live todo progress 2026-04-26 15:55:38 -05:00
messages.ts fix(tui): stabilize live todo progress 2026-04-26 15:55:38 -05:00
osc52.ts fix(tui): raise picker selection contrast with inverse + bold 2026-04-21 14:31:21 -05:00
perfPane.tsx fix(tui): address virtual row and perf log review notes 2026-04-26 21:37:43 -05:00
platform.ts fix(tui): restore macOS copy behavior and theme polish (#17131) 2026-04-28 18:47:14 -05:00
reasoning.ts fix(tui): strip <think>…</think> tags from assistant content and route to reasoning panel 2026-04-18 14:46:38 -05:00
rpc.ts fix(goals): make /goal work in TUI and fix gateway verdict delivery (#19209) 2026-05-03 05:49:12 -07:00
subagentTree.ts refactor(tui): consolidate agents overlay — share duration/root helpers via lib 2026-04-22 12:10:21 -05:00
syntax.ts fix(tui): restore macOS copy behavior and theme polish (#17131) 2026-04-28 18:47:14 -05:00
terminalModes.ts fix(tui): tighten SGR fragment matching 2026-04-30 17:50:49 -05:00
terminalParity.ts fix(tui): raise picker selection contrast with inverse + bold 2026-04-21 14:31:21 -05:00
terminalSetup.ts style(tui): apply npm run fix 2026-04-28 22:18:26 -05:00
text.test.ts fix: clean newline paste thingy 2026-04-13 12:54:48 -05:00
text.ts chore(tui): /clean recent perf work — KISS/DRY pass 2026-04-26 20:38:47 -05:00
todo.test.ts fix(tui): pin todo panel above live output 2026-04-26 15:27:31 -05:00
todo.ts fix(tui): pin todo panel above live output 2026-04-26 15:27:31 -05:00
viewportStore.ts fix(tui): stabilize sticky prompt tracking 2026-04-28 22:10:40 -05:00
virtualHeights.ts chore(tui): remove dead branch cleanup code 2026-04-26 21:54:24 -05:00
wheelAccel.ts chore(tui): /clean recent perf work — KISS/DRY pass 2026-04-26 20:38:47 -05:00