Repository navigation
feat(prompt): answer Hermes's clarify questions from the chat - #750
DarkoKuzmanovic wants to merge 1 commit into
Conversation
|
Thank you for the Hermes clarify card, @DarkoKuzmanovic! It has been carried into #764 (#764), which touches the same file ( One review change was added on top of it (53ae368). Text already on the dialog's |
…swer Hermes, end shut-down teammates (#764) ## Change Fixes four things reported against 0.4.6, all in the prompt reader and the Claude background-task reader. - **Claude multiple choice with ticked rows (#752).** Claude Code 2.1.296 draws a ticked row as `[✔]`; the reader only took `[✓]`, so once a row was ticked the card became a single choice, its labels kept the box, and a pick sent Enter on a multi-select row, which unticks it. `[✔]` is now a tick. With the cursor on the unnumbered **Submit** row the card no longer disappears: the moves count Submit as a row between "Type something" and "Chat about this", so ↑/↓ + Enter + → still land where they should. - **`/model` guard (#542).** `claudeModelListWaits()` read the hint over six lines joined with spaces, so a hint cut inside a word (`ses` / `sion`) or wrapped over seven lines was missed and pending delivery could type Enter into the list. The hint is now read with spaces taken out over up to sixteen lines, and the run of lines that holds it must begin with it, so the same words quoted in Claude's output (`⏺ Example: Enter to set as default …`) no longer hold pending sends. `parseClaudeModel` and `promptTailIsActive` read the hint the same way, so the card and the guard agree. - **Agent-team teammates that shut down (carried from #744 by @Haeminway1).** A teammate that approved its lead's shutdown request is read as completed at that answer, so the pane's running count stops counting it. Cherry-picked with its author kept. - **Hermes clarify questions (carried from #750 by @DarkoKuzmanovic).** Hermes's clarify dialog gets an answer card: arrows + Enter for a choice, Space ticks + Enter for a multiple choice, typed text for "Other" and open questions. No digits are sent, per server/AGENTS.md. Cherry-picked with its author kept, plus one review fix (53ae368): text already on the dialog's `>` line (typed in the terminal, or a typed answer Tab brought back) used to join the chat's answer, so the line is emptied first with ctrl+k / ctrl+u, which Hermes's TextInput takes on every platform (`ui-tui/src/lib/platform.ts`). An unused `currentPrompt` export is dropped. Fixes #752 Fixes #542 Carries #744 and #750 Not changed: #542's gap 4 (a line under the hint that is not Claude's footer). The issue says no real layout is known to draw one, so it is left for a maintainer decision. ## Verification - Before the fix (53ae368), the six new tests failed as the issues describe: the three `Claude's multiple choice ticked in the terminal` tests (no card, single choice, Submit move missing) and the three `Claude Code's model list under a hint wrapped anywhere` tests (split word, seven lines, quoted hint). They pass after 999099b. - `HERDR_TEST_MODE=unit bun test ./server/prompt.test.ts ./server/hermes-prompt.test.ts ./server/claude-subagents.test.ts`: 311 pass, 0 fail. - `bun run typecheck`: passes. - `CHECK_MAX_RUNS=8 bun run check full` on ba61fd4 (after merging origin/main 5792d71): workflow syntax, generated types, typecheck, build, unit tests and the integration and browser lanes all `ok` (252 browser PASS, 0 FAIL). Origin/main was merged in, not rebased (5792d71, #755); the only conflict was CHANGELOG.md. --------- Co-authored-by: Haeminway1 <130830910+Haeminway1@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Darko Kuzmanovic <darko.kuzmanovic@gmail.com>
|
Thank you, @DarkoKuzmanovic! Your change landed on main through #764, with you kept as the commit author and credited in the changelog. Closing this one as superseded by #764. |
Change
A Hermes pane asking a
clarifyquestion showed no answer card:readKnownPromptdid not know the agent, so the phone had to fall back to the terminal.This adds
parseHermesClarifyinserver/prompt.ts, read from the dialog Hermes's Ink TUI draws (ui-tui/src/components/prompts.tsx):(Recommended)dropped from the label, and Hermes's own "Other (type your answer)" row as the custom answer. Answered with ↓ and Enter, like the other menus.N/M answeredas the card body): a typed answer, then Enter.[ ]rows): a multi-select card. The rows to change are ticked with Space, then Enter locks them (Enter on the Other row would open its text line instead, so the cursor is moved off it first). Typed text is not offered there: Hermes adds it to the ticks, which the card has no way to show.The hint line is matched on its start (
N/M answered ·), because a narrow pane wraps its end, and accepted within the last few lines, because Hermes keeps its status bar under the dialog. An answered dialog leaves the screen, so a stale card does not stay.Nothing else changes: no endpoint, frame or UI text.
This complements #604 and #680, which read a Hermes pane's conversation: it shares no code with them (only
server/prompt.tsand its tests, plus a changelog line), and the card works with or without either.Validation
bun run check fast: passes (on the parent commit before the 0.4.6 release; after rebasing onto it, typecheck and the prompt and release-notes tests pass again).server/hermes-prompt.test.ts: captured screens for a choice, an open question in a batch, an answered dialog (no card) and a multi-select question, with theiranswerKeys.server/prompt.test.ts: two rows in "moves to a row that is not the cursor's and answers it" for Hermes, a non-default choice and two ticks, each on a redrawn screen.GET /api/pane/promptreturned the card, andPOST /api/pane/prompt/answerwith the second option made Hermes answer "Blue"; the same answer sent again got409 prompt_changed. A multi-select question answered with Blue and Green reached Hermes as "Blue, Green".