Repository navigation
fix(chat): answer omo's question form from the chat, one question at a time - #237
Conversation
…a time omo 5.1's ask_user_question form (question tabs, numbered options, a typed answer row and a review tab) matched no prompt reader. herdr labels an omo pane `pi` while it waits, so the chat showed the last-resort card with only Enter and Esc. - server/prompt.ts reads the form for pi/omo panes, panes herdr reports without an agent (devswha#224), and claude, which herdr shows while omo's SDK child runs: the question asked now, the review after the last one, and the typed-answer field. A number picks an option as omo does; the review submits, reopens a question, or sends a comment. - The text comes from the ask_user_question call in omo's session file when it can be found, so a pane too short for the form, or one that wraps it, still gets the whole question; otherwise it is read off the screen. - InteractivePrompt gains optional `steps`; the card shows a chip per question. After an answer to such a form the server returns once the next step shows and the card reads it at once.
885b657 to
b4cbd6d
Compare
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: Repository: devswha/herdr-web-ui/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (12)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
The form reader raised a card for the form's text on screens that were not omo's form: printed in a shell, or quoted in Claude's transcript over Claude's input box. A tap would have typed the answer into that program. Under the hint only omo's own footer may follow (blank lines, one rule, a few footer lines), and a pane herdr names claude or not at all needs to be blocked or to have the session's pending call match the tabs on screen. The wait for the form's next step ran inside the pane's serialized turn and held composer input behind it for up to a second; it now runs after the turn and reads with codexHome. A session file not found yet is no longer remembered for 15 s.
# Conflicts: # CHANGELOG.md
|
Thanks for this, @nahwan-kim. Answering omo's form one question at a time from the chat is a real improvement over the Enter/Esc fallback card, and the fixtures for the narrow and cut-off forms made it easy to review. I pushed two commits on top of yours (no rebase): a fix commit and a merge of main, which only conflicted in CHANGELOG.md. The main change is about when the card is offered. The reader accepted any screen where the form's hint line was within ten lines of the bottom, so it also raised a "Question 1 of 2" card on four screens that are not omo's live form: the form's text printed in a shell with the shell prompt below it, the same with a few lines of output after it, the form's text in Claude's transcript with Claude's own input box underneath, and that same Claude screen with the text indented as a quote. A tap on such a card would have typed digits, Backspace, Tab, Enter or free text into the shell or into Claude, and the 409 guard could not catch it because the prompt id is a hash of the same screen. Now only omo's own footer may follow the hint (blank lines, one rule, then at most three footer lines, and never an input box, a second rule or a shell prompt), and a pane that herdr names claude or gives no agent at all additionally has to be blocked, or have a pending ask_user_question in its session that matches the tabs on screen. There is a unit test for each of the four screens; they fail on the previous commit and pass now, and your existing fixtures still produce their cards. Two smaller things went in with it. The wait for the form's next step after an answer ran inside the pane's serialized turn, so a composer message queued for that pane could sit behind it for up to a second; it now runs after the turn has finished, and it passes codexHome through. The answer still returns once the next step is on screen and a stale answer still gets its 409. And the per-pane session path cache no longer remembers a miss, so a form shown right after omo starts is not read off the screen for the next fifteen seconds. I have not run this against a real omo yet, only the fixtures and the contract test's stand-in form. Since the PR adds new card UI, merging waits on the maintainer's explicit go-ahead; nothing more is needed from you for now. |
Release v0.3.39: moves the Unreleased notes under 0.3.39 and bumps `package.json` and `herdr-plugin.toml`. In this release, all fixes: a password sent right after a reconnect (#244), typing and keys outliving their connection (#235), panning a terminal whose grid is not the browser's own on a phone (#241), omo's question form in the chat (#237 by @nahwan-kim), and a held pane resumed by a late herdr answer plus a new shell taken for OmO (#243). No remote bundle change: `REMOTE_BUNDLE_VERSION` stays 9. Changelog housekeeping that was waiting for a release: - Compare links at the bottom now cover 0.3.31 to 0.3.39 (they stopped at 0.3.30), and `[Unreleased]` compares from v0.3.39. - Five references that were a bare `#N` are full PR links with their author: #164 is the issue PR #199 fixed, #154 the issue PR #155 closed, and #45 and #6 are PRs. No other wording of released entries changed. `bun scripts/release-notes.ts 0.3.39` prints the notes and exits 0.
Change
omo 5.1 asks with an
ask_user_questionform: a tab per question, numbered options with descriptions, a "Type your own answer..." row, and a review tab after the last question. No prompt reader knew this screen. herdr labels an omo panepiwhile it waits, so the chat fell back to the last-resort card, which offered only Enter and Esc. omo expects the number of an option.With this change,
server/prompt.tsreads the form for panes herdr reports aspi/omo, panes it reports with no agent (as in #224), andclaude(shown while omo's SDK child runs). The hint lines are specific to omo, so other screens are left alone.Question 1 of 2, with a chip per question (answered ones checked; the current one in the accent). A single choice sends the option's number, as omo does, and omo moves on. A multiple choice clears the answer (Backspace) and then sends the numbers, followed by Tab. A typed answer clears any earlier text first. Picking an answer advances to the next question.ask_user_questioncall in the pane's session file (omoTranscriptForPane, cached for 15 s, reading the file's last 1 MB). The screen only says where the form stands. So a pane too short for the form still gets a card: a 9-option form needs 9 rows instead of 28. A pane that wraps the text no longer garbles it. Without the session file, the card is read off the screen. That path joins Korean words the pane wrapped at its edge back together.InteractivePromptgains an optionalsteps. After answering a form, the answer request returns once omo shows the next step, and the card reads that step right away instead of waiting for the next 2 s poll. A fallback card is suppressed for 3 s after an answer, so herdr's laggingblockedstatus does not flash Enter/Esc once the form closes.Limits:
n/m answeredcount (questions answered in order). If the count doesn't fit that, the earlier chips are left unchecked.Validation
bun run typecheck,bun run build, andgenerate:types --checkpass.test:unit: 657 pass. The same 6 Codex/updater tests fail onupstream/mainon this Mac before the change.server/prompt.test.ts:server/omo-prompt.contract.test.ts, run against a real herdr pane that runs a fake omo form reported aspi. It answers question 1, reads question 2 immediately with its steps, gets a 409 for a stale answer, then submits from the review. The existingprompt.contract.test.tsstill passes.comment-submitted; 2 answered. No card reappeared in the 4 s after submit.Screenshots of the question, review and typing cards, desktop and phone, can be added on request.