Skip to content

fix(chat): answer omo's question form from the chat, one question at a time - #237

Merged
devswha merged 3 commits into
devswha:mainfrom
nahwan-kim:fix/omo-ask-card
Oct 1, 2026
Merged

devswha merged 3 commits into
devswha:mainfrom
nahwan-kim:fix/omo-ask-card

Conversation

@nahwan-kim

Copy link
Copy Markdown
Contributor

Change

omo 5.1 asks with an ask_user_question form: 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 pane pi while 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.ts reads the form for panes herdr reports as pi/omo, panes it reports with no agent (as in #224), and claude (shown while omo's SDK child runs). The hint lines are specific to omo, so other screens are left alone.

  • Question card: shows the question being asked now, titled 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.
  • Review card: after the last question. Submit; tap an answer's row to reopen that question; or type a comment, which omo sends with the answers.
  • Typing card: while an answer is being typed in omo's own field, the card offers to save it (Enter) or discard it (Esc).
  • Text from omo's session: the questions and options come from the pending ask_user_question call 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.
  • Fast transitions: InteractivePrompt gains an optional steps. 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 lagging blocked status does not flash Enter/Esc once the form closes.

Limits:

  • A cut-off form needs at least one option row in view to tell which question it is.
  • With the tabs out of view, the answered state of earlier questions is inferred from omo's n/m answered count (questions answered in order). If the count doesn't fit that, the earlier chips are left unchecked.
  • Card titles and the review's "Submit" are English server strings, like the Codex and Claude cards.

Validation

  • bun run typecheck, bun run build, and generate:types --check pass.
  • test:unit: 657 pass. The same 6 Codex/updater tests fail on upstream/main on this Mac before the change.
  • New unit tests in server/prompt.test.ts:
    • fixtures taken from omo 5.1.7 as herdr reads it at 120 columns, and from omo's own renderer at 40 and 60 columns;
    • session-file parsing (pending, answered, moved on, malformed, a tail starting mid-record);
    • cut-off forms with and without the session;
    • the typing card;
    • the review with its rows out of view.
  • New server/omo-prompt.contract.test.ts, run against a real herdr pane that runs a fake omo form reported as pi. It answers question 1, reads question 2 immediately with its steps, gets a 409 for a stale answer, then submits from the review. The existing prompt.contract.test.ts still passes.
  • Manual QA against real omo 5.1.7 in an isolated herdr session, in headless Chromium with the Korean UI:
    • Desktop: question 1 → question 2 (shown 96–307 ms after the tap) → review → reopen question 1 → typed answer → submit with a comment. omo received comment-submitted; 2 answered. No card reappeared in the 4 s after submit.
    • Phone (390 px), driven with real touch taps: multiple choice → question 2 → review → submit.
    • A pane resized to 15 rows with the title and tabs off screen: the card came from the session file. Then option 4, a typed answer, the review and submit, all through the API. A typing card was raised from the terminal and saved from the card.

Screenshots of the question, review and typing cards, desktop and phone, can be added on request.

…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.
@coderabbitai

coderabbitai Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

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 configuration

Configuration used: Repository: devswha/herdr-web-ui/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: cbe6e16f-929b-49c1-a968-7259a34f0d4c

📥 Commits

Reviewing files that changed from the base of the PR and between c3f7b59 and 19813df.

📒 Files selected for processing (12)
  • CHANGELOG.md
  • DESIGN.md
  • server/omo-prompt.contract.test.ts
  • server/prompt.test.ts
  • server/prompt.ts
  • shared/protocol.ts
  • src/components/ChatView.tsx
  • src/components/PromptCard.css
  • src/components/PromptCard.tsx
  • src/lib/i18n.ja.ts
  • src/lib/i18n.ko.ts
  • src/lib/i18n.zh.ts
 ___________________________________________________________________
< Your tests are like unicorns: frequently referenced, rarely seen. >
 -------------------------------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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

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.
@devswha

devswha commented Oct 1, 2026

Copy link
Copy Markdown
Owner

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.

@devswha
devswha merged commit f8a74c4 into devswha:main Oct 1, 2026
11 of 13 checks passed
devswha added a commit that referenced this pull request Oct 1, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants