Repository navigation
fix(native-chat): answer OMP ask questions with navigation keys - #26688
jairuspace wants to merge 3 commits into
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe change adds OMP-specific answer-key generation for native chat selector prompts. Parsing now recognizes Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to OMP answers are routed through paced selector keys on desktop and mobile. The reported OMP 17.2.12 custom-text cases remain unverified, but no actionable current-head failure is established. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
5f4e59c4-99b5-4303-bf55-53751891f4b7
📥 Commits
Reviewing files that changed from the base of the PR and between bb44f74 and 5dd1320d67442c62099cffdfa1ba4b193bb7b2f1.
📒 Files selected for processing (8)
mobile/src/session/use-mobile-native-chat-answer-send.tssrc/renderer/src/components/native-chat/native-chat-interactive-prompt.test.tssrc/renderer/src/components/native-chat/native-chat-interactive-prompt.tssrc/renderer/src/components/native-chat/use-native-chat-interactive-send.tssrc/shared/native-chat-agent-support.test.tssrc/shared/native-chat-agent-support.tssrc/shared/native-chat-ask.test.tssrc/shared/native-chat-ask.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
c200276 to
4ce926e
Compare
|
@coderabbitai review |
|
|
@coderabbitai full review |
✅ Action performedFull review finished. |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
4f4ee79b-dd11-4b14-bd10-d746a1db75be
📒 Files selected for processing (9)
mobile/src/session/use-mobile-native-chat-answer-send-omp.test.tsmobile/src/session/use-mobile-native-chat-answer-send.tssrc/renderer/src/components/native-chat/native-chat-interactive-prompt.test.tssrc/renderer/src/components/native-chat/native-chat-interactive-prompt.tssrc/renderer/src/components/native-chat/use-native-chat-interactive-send.tssrc/shared/native-chat-agent-support.test.tssrc/shared/native-chat-agent-support.tssrc/shared/native-chat-ask.test.tssrc/shared/native-chat-ask.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
|
Live test in the desktop app (dev build of this branch, macOS, OMP 18.8.6, real model): started OMP in a terminal, switched the tab to chat view, and had OMP call
Noticeably slow to submit. After pressing Submit, the card spins for several seconds before it dismisses. This is the existing answer sender's pacing: every key group goes out There's room to speed this up for OMP. OMP's input buffer splits a single write into separate keys and applies each one immediately. The real-binary harness already passes every scenario at 400 ms gaps, and a move plus Enter/Space could share one write. I've kept the shared 1 s pacing in this PR so OMP uses the same sender as Claude and Codex, and I'm happy to tighten OMP's pacing here or in a follow-up if maintainers prefer. Two things I found while testing, which this PR doesn't change:
Still not covered: the phone. The answer path there uses the same shared key builder, and a unit test covers its pacing. A live check needs a mobile build of this branch, because the store app doesn't include the change. |
|
Verified this PR against OMP 18.11.0 (the latest release, newer than the 18.8.7 checked above) on Windows, and adding a mobile field report. Field report (iPhone app). Orca 1.4.226 on Windows 11, Orca iOS app, OMP 18.11.0. On a 4-question OMP 18.11.0's dialog. Diffed Driving OMP 18.11.0's real
10/10 pass with this PR. The paste path reproduces the bug in every row. Merge with current Not covered: the mobile test file (no mobile deps installed here) and a live run on the phone, which needs a mobile build of this branch. Since the phone builds these keys itself, phone users only get the fix from an app release. A merge plus a mobile release would unblock OMP from the phone. AI assistance disclosure: prepared with Claude via OMP. The field report is my own. The diff, harness, merge and test runs were done locally on Windows, and the limits are stated above. |
|
Superseded by #31440, now merged. Thank you for the original contribution; contributor credit is preserved in the merge commit. Verification against the OMP source exposed state-dependent failures in keyboard-driven submission, so the replacement deliberately offers Answer in terminal and prevents automated OMP question-answer/cancel writes. Automatic semantic card answering remains open in #26692. |
ELI5
When OMP (Oh My Pi) asks a question in Orca's chat view, on desktop or on the phone, clicking an answer used to either pick the wrong choice or leave OMP stuck waiting. That happened because Orca typed the answer as text, and OMP's question box doesn't read typed text. Now Orca presses the same keys a person would press in the terminal: arrows to move, Space to tick a box, and Enter to choose.
What Changed
Before: For OMP, the chat card sent the answer like a chat message: clear the line, paste the label (for example
B), then press Enter. OMP'saskdialog moves a highlight with the arrow keys, has no number shortcuts, and ignores pasted text. So the Enter acted on whatever row was highlighted:recommendedoption, or the first one), not the option the user picked.multi: trueand Orca only readmultiSelect(and OpenCode'smultiple), so those questions showed up as single-select cards.After:
shouldStepNativeChatAskAnswernow includesomp. OMP answers go through the same paced key-by-key sender that Claude, Codex and OpenCode already use, on desktop and on mobile.buildOmpAskAnswerKeysfollows OMP's dialog (OMP ≥ 18.2.0):AGENT_TUI_CLEAR_INPUT_MAX(Ctrl+U/Ctrl+K, 40 lines). While that box holds text, OMP sends the dialog's keys to it, so the first Enter would send the leftover text to OMP as a new message. The dialog ignores both keys.buildNativeChatAskAnswerKeys(agent, …)picks each agent's key builder: Codex, OMP, or Claude-style (Claude, OpenClaude and OpenCode). Desktop and mobile both call it, so the choice lives in one place.multi: truenow counts as multi-select, alongsidemultiSelectand OpenCode'smultiple.Supported OMP versions: 18.2.0 and later. The
askdialog's keys work the same from 18.2.0 through 18.8.7, the latest release. Single-select answers also work on 17.x. On 17.x and 18.0.x, multi-select questions answered with free text still don't go through, because those versions don't move on after the "Other" editor closes.Why
Nothing in OMP's dialog accepts the answer as text, so the paste-and-Enter path can't work for it. Pressing keys is the only way the dialog takes input.
recommendedvalue and move from there, which ties the answer to OMP's starting cursor and adds a field to the shared question type. Pressing Up on the top row does nothing, so the extra presses are harmless.Linked Issue
Fixes #26692 (also covers #26198, which was merged into it)
Visual Proof
N/A: no layout or visual change. The fix changes which keys are sent to the terminal. The before/after results are listed under Testing.
Testing
Correction: an earlier version of this PR said it was checked against OMP 18.8.6's dialog. That check actually loaded a stale 17.2.12 copy of OMP's source, which is how the multi-select bug that shryu1994 and CodeRabbit reported got through. Everything below runs the matching OMP version.
1. Real
omp18.8.6 binary in a terminal, no model needed. A small OMP extension command opensctx.ui.askDialog, the same dialog theasktool uses, and writes OMP's result to a file. A driver runsomp --extension …in a pseudo-terminal, types the command, and writes Orca's key groups 400 ms apart. That's faster than Orca's 1 s pacing, so it's a stricter test. The table shows what OMP returned for each answer:In all three leftover-text cases, OMP showed its own "Finish or clear the current prompt to answer" notice before the keys arrived. Nothing was sent as a chat message.
2. The same scenarios plus 30- and 45-line leftover-text cases (13 in total) against each OMP version's own dialog code, installed from npm:
The 30-line leftover-text case passes on every version. The one failure on every version is a deliberate case with 45 lines typed one at a time, beyond the 40-line clear.
3. Before (paste + Enter), on 18.8.6:
Automated checks:
multiparsing.use-mobile-native-chat-answer-send-omp.test.ts) checks that the phone sends OMP's key groups one at a time, paced, and never pastes the label. It's a separate file because the existing test file is at the line limit.pnpm test src/shared/ src/renderer/src/components/native-chat/: 16,090 tests pass. All 25 failures are in the|bun|project, in 8 files this PR doesn't touch (utf8-byte-limits,agent-image-paste,check-job-log-byte-cap,git-diff-transport-budgetand fourremote-runtime-*socket tests). This machine has Bun 1.3.14 and CI pins 1.4.2 inconfig/.bun-version. The node project passes in full.pnpm typecheckandpnpm run check:code-quality:changedpass.pnpm lintstep passes on this branch except one: the native code-quality step reports fiveimport/no-cyclewarnings in untouched mobile transport and terminal files. Those appear only whenmobile/node_modulesis installed, and the same five warnings appear on a cleanmaincheckout.pnpm install --frozen-lockfile,pnpm typecheck,pnpm lintandpnpm format:checkpass.pnpm testpasses exceptmobile-e2ee-v2-client-session.test.ts, which fails the same way on a cleanmaincheckout.pnpm buildcompletes the desktop build. Only the native macOS computer-use helper fails, at its universal-binarylipostep: this machine has a single-architecture install, and that step needspnpm install:release. This change doesn't touch it.4. Live, in the desktop app (dev build of this branch, real model, OMP 18.8.6): single choice (a non-recommended option), multi-select and typed free text were all delivered correctly from the chat card, and OMP carried on with the turn. Submitting takes several seconds, because of the shared 1 s pacing between key groups (details in the PR comments). Not yet tested live: the phone, which needs a mobile build of this branch.
AI Disclosure
Written with Claude (Anthropic) in Oh My Pi. The analysis uses OMP's tagged source for each version. Testing used the published npm packages and the real
ompbinary.Review
An AI review of the diff covered correctness against OMP's dialog source, cross-platform, SSH and remote, agent compatibility, mixed versions, performance, UI, and security. Reviewer feedback from shryu1994 and CodeRabbit is addressed in this revision.
AskDialogComponentfrom 18.2.0 through 18.8.7. Shown by the real-binary run and the per-version runs above.Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred). The failures that remain are listed under Testing and also happen onmainor in untouched native code.