Skip to content

fix(prompt): read Claude's ticked choices and wrapped /model hint, answer Hermes, end shut-down teammates - #764

Merged
devswha merged 7 commits into
mainfrom
fix/claude-parse-0.4.6
Oct 11, 2026
Merged

devswha merged 7 commits into
mainfrom
fix/claude-parse-0.4.6

Conversation

@devswha

@devswha devswha commented Oct 11, 2026

Copy link
Copy Markdown
Owner

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 (Claude multi-select question: ticked [✔] rows read as a single choice, and the cursor on Submit loses the card #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 (Model-list guard: a hint split inside a word or over more than six lines is missed, and a quoted hint holds pending delivery #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 fix(claude): a teammate that approved its shutdown is no longer counted as running #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 feat(prompt): answer Hermes's clarify questions from the chat #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.

Haeminway1 and others added 6 commits October 11, 2026 10:05
…ed as running

An agent-team teammate ends by answering its lead's shutdown_request with
SendMessage(shutdown_response, approve: true); Claude Code's tool result
says "Shutdown approved … is now exiting" and nothing follows. turnAfter
took only an end_turn answer as the end, and the shutdown request after
it reset that, so every shut-down teammate read as running forever: a
live pane showed 12 background tasks with 1 background shell and no
subagent alive. That approved answer now ends the agent's turn; any later
message still resumes it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Text already on the clarify dialog's `>` line (typed in the terminal, or a
typed answer Tab brought back) joined the answer sent from the chat. The
line is emptied first with its TextInput's ctrl+k and ctrl+u, as pi's
dialog is, for an open question and for the Other row.

Also drops currentPrompt, an export nothing called.
…ped /model hint

Claude Code 2.1.296 draws a ticked multiple-choice row as [✔]. The reader only
took [✓], so a ticked question became a single choice whose labels kept the
box, and a pick there toggled the row instead of answering (#752). With the
cursor on the unnumbered Submit row no row was selected and the card went
away; the moves now count Submit as the row it is, before "Chat about this".

The /model list's hint is read with its spaces taken out over up to sixteen
lines, so a hint cut inside a word or wrapped over seven lines still holds
pending delivery and still reads as a card. The run of lines must begin
with the hint, so the same words quoted in Claude's output (after a ⏺
bullet) hold nothing. parseClaudeModel and promptTailIsActive read the hint
the same way as the guard (#542).
@coderabbitai

coderabbitai Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration
  • Configuration used: Repository: devswha/herdr-web-ui/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e4b36fe0-9bf5-44ec-a3ab-41712d805e93

📥 Commits

Reviewing files that changed from the base of the PR and between 64cd1c3 and 724b876.


You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: devswha/herdr-web-ui/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b1c253a2-e650-4b7c-9ec0-4f19dc666c2c


📥 Commits

Reviewing files that changed from the base of the PR and between 5792d71 and 64cd1c3.



📒 Files selected for processing (6)
  • CHANGELOG.md
  • server/claude-subagents.test.ts
  • server/claude-subagents.ts
  • server/hermes-prompt.test.ts
  • server/prompt.test.ts
  • server/prompt.ts


Limit details: You’ve used all 10 included reviews currently available.




📝 Summary

Summary by CodeRabbit

  • New Features
    • Hermes clarification questions now support one-tap choices, multiple selections, and typed answers for “Other” or open-ended questions. Answered questions are cleared from the active cards.
  • Bug Fixes
    • Improved Claude teammate status updates after approved shutdowns and when teammates send later messages.
    • Fixed Claude Code multiple-choice behavior after terminal selections.
    • Improved recognition of wrapped /model lists while avoiding false matches in quoted output.
📝 Summary

Walkthrough

Claude prompt parsing now handles wrapped model-list hints and multiple-choice Submit states. Hermes clarify questions support typed, single-choice, and multi-select answers. Approved Claude teammate shutdowns now mark the turn as complete until a later message.

Changes

Claude and Hermes Prompt Handling

Layer / File(s) Summary
Claude model-list recognition
server/prompt.ts, server/prompt.test.ts
Model-list hint matching handles wrapped text and checks that a matching hint remains at the screen tail. Tests cover wrapped hints and quoted or stale matching text.
Claude multi-select navigation
server/prompt.ts, server/prompt.test.ts, CHANGELOG.md
Claude question parsing recognizes [✔] checked rows and handles the Submit row in selection and cursor state. Tests cover checked rows and Submit navigation. The changelog records the fixes.
Hermes clarify-question handling
server/prompt.ts, server/hermes-prompt.test.ts, server/prompt.test.ts, CHANGELOG.md
Hermes prompt handling parses questions and typed inputs, and builds answer steps for single- and multi-select choices. Tests cover parsing and key sequences. The changelog describes the answer cards.

Claude Teammate Shutdown

Layer / File(s) Summary
Approved shutdown completion
server/claude-subagents.ts, server/claude-subagents.test.ts
A successful shutdown approval marks the teammate turn as complete at the tool-result timestamp. A later user message returns the teammate to running. Tests cover approved and rejected shutdowns and a later message.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: kilhyeonjun, haeminway1



Merge Risk: ⚪ Minimal · up to 64cd1

No actionable issue was established that prevents merging after normal checks.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 64cd1

Existing access restrictions remain in place. Newly supported multi-step input actions have a limited risk of modifying the wrong terminal input during concurrent changes, and compatibility with external interfaces remains partly verified.

Retained concerns

  • Low · security · inferred: New Hermes answers can begin with Space, Enter, or input-clearing keys without an additional live-screen check when no navigation is needed. If the dialog changes or is dismissed after the initial read without an observed asking-end transition, these keys and subsequent answer text can modify or submit unrelated terminal input. The executor policy predates this PR, but the new Hermes transitions inherit it; existing authentication, serialization, fresh reads, and asking-state checks constrain the exposure.
Security review details

Security Blast Radius

  • inferred — The retained concern is confined to the selected existing pane. It requires an authorized answer request plus a concurrent terminal-state change that escapes the observed asking lifecycle; no unauthenticated entry or new credential grant was established. Any wrong-context input would act with that terminal's existing authority.

Trust Boundaries and Controls

  • observed — Hermes recognition requires the matching pane agent, an ask header, an active question marker, an answered hint, and a live-tail check. Choice parsing requires a final Other row and rejects mixed checkbox formats. These are rendered-screen controls, not an authenticated producer-side question identifier.

Resilience and Maintainability Implications

  • observed — Delivery awaits each step and checks asking validity before each key. Cancellation is checked before commitment; potentially delivered mutations end the asking even when acknowledgment fails, except a first-step connection failure. This limits replay after partial failure but does not make the external terminal transition atomic or roll back already delivered input.

Hardening Proposals

  • proposed — Re-observe the expected Hermes dialog and mutable answer state before its first mutation, including no-navigation paths. Confirm input-clearing shortcuts and shutdown-result shape against the external producer contracts rather than relying only on generated-key and synthetic-transcript tests.

Pre-merge checks | Passed 3 | Failed 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Out of Scope Changes check Warning The Hermes clarify-question implementation and tests, plus the Claude teammate shutdown-completion change and tests, do not implement #752 or #542. The current PR description identifies them as carrie… Move the Hermes and teammate shutdown changes, including their tests and changelog entries, to PRs scoped to #750 and #744, or provide active direct issue scope that makes those changes part of this PR.
Docstring Coverage Warning Docstring coverage is 43.75% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 16 functions across 5 files. (1 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check Passed The title clearly identifies the main prompt-reader fixes and the teammate shutdown handling. It is specific and related to the changes, although it combines several changes in one sentence.
Description check Passed The description includes a detailed Change section and comprehensive validation results. It uses the heading "Verification" instead of the template's "Validation" heading, but it provides the required…
Linked Issues check Passed The changes satisfy the active coding requirements for #752 and #542. server/prompt.ts accepts [✔], removes the checkbox from labels, preserves the Claude card on the unnumbered Submit row, and in…


Full details: Out of Scope Changes check

Explanation

The Hermes clarify-question implementation and tests, plus the Claude teammate shutdown-completion change and tests, do not implement #752 or #542. The current PR description identifies them as carried work for #750 and #744, but those issues are not active directly linked targets in this assessment.



Full details: Docstring Coverage

Explanation

Docstring coverage is 43.75% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 16 functions across 5 files. (1 skipped: 1 unsupported.)




✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR





🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR



  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@devswha
devswha merged commit e103932 into main Oct 11, 2026
13 checks passed
@devswha
devswha deleted the fix/claude-parse-0.4.6 branch October 11, 2026 02:29
DarkoKuzmanovic added a commit to DarkoKuzmanovic/herdr-web-ui that referenced this pull request Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants