Repository navigation
fix(prompt): keep a timed pi confirm's and text input's card through its countdown - #1888
Conversation
…its countdown
senpi asks a confirm as a select titled "${title}\n${message}", so a timeout's
"(Ns)" ends the message line, the card's question; its text input counts down
at the end of its title. Both were hashed with the count, so the card id changed
every second and an answer tapped after a tick was refused as prompt_changed.
The id now reads every pi dialog's words without the count that ends their last
line, also when a narrow pane wrapped the count onto a line of its own ("(10s)"
may wrap where "(9s)" fits). A "(30s)" on an earlier line stays part of the
text. The card still shows the count.
Fixes #1509
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Parse dialogs and verify stable prompt IDs server/dialogs/pi.ts, server/prompt.test.ts, changelog.d/pi-timed-dialog-card-id.md |
Parsing strips a trailing countdown from the final dialog line and constructs input and confirmation prompts from separate title and question lines. Tests check prompt IDs across countdown changes, wrapped countdowns, and message or title changes. The changelog describes the stale-answer behavior. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Medium
Possibly related issues
- Command Code support: follow-ups from #1399's review #1445 — Describes stale answers when dynamic terminal content changes a permission card ID. This PR addresses the same failure mode for timed Pi and OmO dialogs, but not Command Code card hashing.
- pi/OmO: drop the countdown from timed confirm and input card ids (#1495 follow-ups) #1509 — Requests stable timed confirmation and input card IDs, which this PR addresses for Pi and OmO dialogs.
Possibly related PRs
- devswha/ovis#1714 — Both PRs keep Pi prompt identity stable when transient screen content changes;
#1714covers rpiv questions, while this PR covers standard Pi dialogs.
Suggested reviewers: nahwan-kim
Merge Risk: 
Minimal · up to 44ff4
-
Timed dialog answers can retain a stable card ID as the countdown changes, with the countdown still visible. No actionable merge risk remains after normal checks.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Description check
-
Explanation
The description explains the problem, resulting behavior, implementation scope, known behavior, linked issue, and validation results. It uses custom headings instead of the template's exact Change and Validation headings, but it provides the required information in substance.
Full details: Linked Issues check
-
Explanation
Issue
#1509requires stable card IDs for timed pi/OmO confirm and text-input dialogs, plus tests for both cases.server/dialogs/pi.tsnow removes a countdown only from the final dialog line before calculating the ID. Confirm messages and input titles therefore keep the same ID across ticks.server/prompt.test.tscovers normal ticks, a count wrapped onto its own line, changed dialog words, and an earlier-line count. The implementation meets the linked coding requirements.
Full details: Out of Scope Changes check
-
Explanation
The changes stay within the linked issue scope. The parser change centralizes countdown removal for the affected pi dialog branches and preserves counts on earlier lines. The tests verify the required confirm and input behavior. The changelog documents the fix. No unrelated product behavior or files are changed.
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. (1 skipped: 1 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
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
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 @coderabbitai help to get the list of available commands.
|
Merge pass review-work report. Overall: PASSED.
QA
Gate
All required checks are green and no review thread is open. |
What it does for the user
A pi or OmO dialog asked with a timeout counts down every second (
(9s),(8s), ...). The chat card's id hashed that count, so a Yes/No or a typed answer tapped a second after the card was read was refused with409 prompt_changedand the user had to reopen the card. #1495 fixed this for a select's title only; a confirm and a text input still changed id on every tick. Now every pi dialog keeps one card id through its countdown, and the card still shows the count.Why
${title}\n${message}(interactive-mode.jsshowExtensionConfirm), so the count ends the message line, which is the card'squestion. fix(chat): read OmO's pick lists, which name Escape esc and count down in the title #1495 stripped it from the confirm's title only.extension-input.js) counts down at the end of its title, which the input branch ofparsePiDialoghashed as it was.Change
server/dialogs/pi.ts: the id reads the dialog's words without the count that ends their last line, on every branch (select, confirm, input). A count a narrow pane wrapped onto a line of its own ((10s)can wrap where(9s)fits) is dropped with that line. A(30s)on an earlier line stays part of the text, so two different questions do not share an id.server/prompt.test.ts("pi's dialogs"): a timed confirm and a timed input keep one id across a tick, including the count wrapped alone and a real(30s)on an earlier line; different words still give a different id.changelog.d/pi-timed-dialog-card-id.md.Known and accepted, as #1495 already did for selects: an untimed dialog whose own words end in
(Ns)is read as counting down.How it was verified
d2eacc0292a1vsff5fad8af1fa,26a13ea40fd3vs05ce2ad84c8c) and pass here.bun test server/prompt.test.ts server/dialogs: 483 pass, 0 fail.createServer({ port: 0 })and two panes reported aspi, each drawing senpi's confirm or text input with a 1 s countdown.GET /api/pane/promptat(76s)and(75s)gave idsba96dea3e515/2fdf080bbccf;POST /api/pane/prompt/answerwith the first id answered409 prompt_changedand the pane got nothing (same for the input).(85s)and(84s); the POST with the first id answered200 {"ok":true}and the pane received "No" (confirm) and "feat/x" (input).omo-native-code-reviewerAPPROVE (two LOW notes, both the accepted behaviour above). Codex (gpt-6.1-sol, xhigh) first asked for two changes (a count stripped from earlier lines; a count wrapped alone not matched); both are fixed and covered by tests, and its re-review is APPROVE with no findings.bun run check fast(throughdori heavy) on this commit: typecheck, build and unit tests ok (6395 pass, 0 fail, 13 skip).Fixes #1509