Skip to content

fix(prompt): keep a timed pi confirm's and text input's card through its countdown - #1888

Merged
devswha merged 1 commit into
mainfrom
fix/pi-countdown-card-ids
Oct 24, 2026
Merged

devswha merged 1 commit into
mainfrom
fix/pi-countdown-card-ids

Conversation

@devswha

@devswha devswha commented Oct 24, 2026

Copy link
Copy Markdown
Owner

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 with 409 prompt_changed and 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

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

  • The new cases fail on main (ids d2eacc0292a1 vs ff5fad8af1fa, 26a13ea40fd3 vs 05ce2ad84c8c) and pass here. bun test server/prompt.test.ts server/dialogs: 483 pass, 0 fail.
  • Live, over HTTP, against an isolated herdr session (never the user's): an Ovis createServer({ port: 0 }) and two panes reported as pi, each drawing senpi's confirm or text input with a 1 s countdown.
    • main: GET /api/pane/prompt at (76s) and (75s) gave ids ba96dea3e515 / 2fdf080bbccf; POST /api/pane/prompt/answer with the first id answered 409 prompt_changed and the pane got nothing (same for the input).
    • this branch: the same id at (85s) and (84s); the POST with the first id answered 200 {"ok":true} and the pane received "No" (confirm) and "feat/x" (input).
  • Reviews: omo-native-code-reviewer APPROVE (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 (through dori heavy) on this commit: typecheck, build and unit tests ok (6395 pass, 0 fail, 13 skip).

Fixes #1509

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

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 4c46992 and 44ff416.

Files selected for processing: 3
  • changelog.d/pi-timed-dialog-card-id.md
  • server/dialogs/pi.ts
  • server/prompt.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 1 remain after this review.

📝 Summary

Summary by CodeRabbit

  • Bug Fixes
    • Timed pi and OmO confirmations and text-input prompts no longer appear stale when tapped after the countdown changes.
    • Prompts keep their identity as countdowns tick or wrap onto a separate line. Changes to the message or prompt text still result in a distinct card.

Pi dialog parsing now excludes trailing countdowns from stable prompt text and separates title and question lines. Tests verify that timed confirmation and text-input prompt IDs remain stable as countdowns change or wrap.

Changes: Timed Pi dialogs

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: Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Possibly related issues

Possibly related PRs

  • devswha/ovis#1714 — Both PRs keep Pi prompt identity stable when transient screen content changes; #1714 covers 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: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning 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 … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: preserving a timed pi confirm and text input card across countdown updates.
Description check Passed 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…
Linked Issues check Passed Issue #1509 requires stable card IDs for timed pi/OmO confirm and text-input dialogs, plus tests for both cases. server/dialogs/pi.ts now removes a countdown only from the final dialog line before c…
Out of Scope Changes check Passed 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…
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 #1509 requires stable card IDs for timed pi/OmO confirm and text-input dialogs, plus tests for both cases. server/dialogs/pi.ts now 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.ts covers 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.

❤️ Share

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

@devswha

devswha commented Oct 24, 2026

Copy link
Copy Markdown
Owner Author

Merge pass review-work report. Overall: PASSED.

Lane Verdict Confidence
Manual QA (artifacts kept) PASS -
Gate review (another model; programming + remove-ai-slops applied directly) APPROVE HIGH

QA

  • The prompt and conventions tests pass (362), and so does the typecheck.
  • git merge-tree is clean.
  • No other open maintainer PR touches these files.

Gate

  • A pi confirm (count at the end of its message line) and a pi text input (count at the end of its title) keep one card id through the countdown. The card still shows the count.
  • Each of these still gets a different id: another question, title or set of options, and an ordinary dialog with no timeout. 15 identity assertions pass.
  • Both new regression tests fail against the pre-fix code.
  • Accepted by the PR: untimed text that happens to end in (Ns) is ambiguous.

All required checks are green and no review thread is open.

@devswha
devswha merged commit b6455aa into main Oct 24, 2026
18 checks passed
@devswha
devswha deleted the fix/pi-countdown-card-ids branch October 24, 2026 19:02
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.

pi/OmO: drop the countdown from timed confirm and input card ids (#1495 follow-ups)

1 participant