feat(onboarding): port first-touch hints to the TUI (#16054)

PR #16046 added /busy and /verbose hints to the classic CLI and the
gateway runner but skipped the Ink TUI (and therefore the dashboard
/chat page, which embeds the TUI via PTY).  This extends the same
latch to the TUI with TUI-native wording.

The TUI's busy-input model is not the /busy knob from the CLI —
single Enter while busy auto-queues, double Enter on an empty line
interrupts.  The new busy-input hint teaches THAT gesture instead of
telling the user to flip a config that does not apply.

Changes:
- agent/onboarding.py — add busy_input_hint_tui() + tool_progress_hint_tui()
- tui_gateway/server.py — onboarding.claim JSON-RPC (Ink triggers busy
  hint on enqueue) + _maybe_emit_onboarding_hint helper hooked into
  _on_tool_complete for the 30s/tool_progress=all path.  Same
  config.yaml latch so each hint fires at most once per install across
  CLI, gateway, and TUI combined.
- ui-tui/src/gatewayTypes.ts — OnboardingClaimResponse + onboarding.hint event
- ui-tui/src/app/createGatewayEventHandler.ts — render the hint event as sys()
- ui-tui/src/app/useSubmission.ts — claim busy_input_prompt on first
  busy enqueue
- tests/agent/test_onboarding.py — +3 cases for TUI hint shape
- tests/tui_gateway/test_protocol.py — +4 cases for onboarding.claim
- website/docs/user-guide/tui.md — new 'Interrupting and queueing'
  section explaining the TUI's double-Enter model and the hints

Validation:
scripts/run_tests.sh tests/agent/test_onboarding.py \
  tests/tui_gateway/test_protocol.py \
  tests/gateway/test_busy_session_ack.py
  -> 66 passed
npm --prefix ui-tui run type-check -> clean
npm --prefix ui-tui run lint       -> clean
npm --prefix ui-tui run build      -> clean
This commit is contained in:
Teknium
2026-04-26 06:24:19 -07:00
committed by GitHub
parent 1e37ddc929
commit ffd2621039
8 changed files with 291 additions and 2 deletions

View File

@@ -10,10 +10,12 @@ from agent.onboarding import (
TOOL_PROGRESS_FLAG,
busy_input_hint_cli,
busy_input_hint_gateway,
busy_input_hint_tui,
is_seen,
mark_seen,
tool_progress_hint_cli,
tool_progress_hint_gateway,
tool_progress_hint_tui,
)
@@ -128,6 +130,14 @@ class TestHintMessages:
def test_tool_progress_hints_mention_verbose(self):
assert "/verbose" in tool_progress_hint_gateway()
assert "/verbose" in tool_progress_hint_cli()
assert "/verbose" in tool_progress_hint_tui()
def test_busy_input_hint_tui_teaches_double_enter(self):
msg = busy_input_hint_tui()
# TUI uses double-Enter as the interrupt gesture, not /busy.
assert "Enter" in msg
assert "queued" in msg.lower()
assert "/busy" not in msg
def test_hints_are_not_empty(self):
for hint in (
@@ -135,8 +145,10 @@ class TestHintMessages:
busy_input_hint_gateway("interrupt"),
busy_input_hint_cli("queue"),
busy_input_hint_cli("interrupt"),
busy_input_hint_tui(),
tool_progress_hint_gateway(),
tool_progress_hint_cli(),
tool_progress_hint_tui(),
):
assert hint.strip()