Skip to content

fix(prompt): keep the stale-read count across a poll restart (#1418) - #1856

Merged
devswha merged 3 commits into
mainfrom
fix/prompt-stale-notice-followups-v2
Oct 24, 2026
Merged

devswha merged 3 commits into
mainfrom
fix/prompt-stale-notice-followups-v2

Conversation

@devswha

@devswha devswha commented Oct 24, 2026

Copy link
Copy Markdown
Owner

Follow-up to #1418. The waits in the test and the count of Playwright's waitForTimeout as a fixed sleep already landed in #1440; this PR ships what was left.

What it does for the user

A question card says "Not updated: the question on screen may have changed." once two reads of the screen in a row have failed. The failed-read count was local to each run of the poll effect. So a restart of the poll (a refused answer, or the page shown again) reset it to zero: a failed read, a refused answer and one more failed read never showed the notice, even though the screen had not been read for two polls. The count now lives in a ref and carries across a restart. A read that answers, or the poll stopping (disconnect, the pane ending), still clears it. Reads from a poll that a restart cancelled change the count for neither side, so a late success or failure from the old poll cannot hide or fake the notice.

No new UI: the card, the notice and its wording stay as they were.

Test cleanup

  • // fixed wait: <why> markers on Playwright waitForTimeout calls that prove something does not happen (no send, no dialog, focus not moved). Waits that only let something settle before a positive check stay counted. scripts/fixed-sleeps.json only goes down (for example ui-regression 33 → 14, prompt-dock 6 → 1).
  • One 100 ms wait in terminal-input-regression.ts came before a positive check (the note or the draft must change), so it now waits for that change with until(...), as the tab paste just above it does.

Verification

  • bun scripts/prompt-dock-demo-regression.ts: 28 PASS, including the new case "a restarted poll counts the failed reads before it". With ChatView.tsx reverted to main, the new case times out (waitForFunction: Timeout 10000ms exceeded).
  • bun scripts/terminal-input-regression.ts: passes.
  • bun run check fast: passes (typecheck, build, unit tests including scripts/conventions.test.ts).
  • Reviews: omo-native-code-reviewer (APPROVE, no HIGH findings) and Codex. Both raised the cancelled-poll write to the shared count (fixed, see above), and the reviewer flagged the terminal-input settle wait (fixed).

Known follow-up, not changed here: ChatView is keyed by paneId only, so the same pane id on another machine would keep promptStale. That was already true before this PR.

mp added 3 commits October 24, 2026 21:16
The failed-read count lived inside the poll effect, so a refused answer or the page shown again restarted it at zero: one failed read, a refused answer and one more failed read never showed the Not updated notice. It now lives in a ref, changed only by reads of the poll still running. A new prompt-dock case holds the reads so exactly one fails on each side of the restart.
Each marked waitForTimeout waits to show that nothing happens; settle waits before a positive assertion stay counted. scripts/fixed-sleeps.json shrinks to match.
… of a fixed wait

The 100 ms wait came before a check that the banner or the draft changed, so it was a settle wait, not a wait proving absence. It now waits for that change as the tab paste above it does.
@coderabbitai

coderabbitai Bot commented Oct 24, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 12 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between 8fe7da9 and e5bbc1a.

Files selected for processing: 17
  • DESIGN.md
  • changelog.d/prompt-stale-notice-count.md
  • scripts/chat-browser-qa.ts
  • scripts/deep-link-demo-regression.ts
  • scripts/fixed-sleeps.json
  • scripts/machines-browser-qa.ts
  • scripts/math-browser-qa.ts
  • scripts/phone-split-grid-demo-regression.ts
  • scripts/prompt-dock-demo-regression.ts
  • scripts/restored-draft-demo-regression.ts
  • scripts/telemetry-regression.ts
  • scripts/terminal-command-backspace-regression.ts
  • scripts/terminal-ctrl-enter-regression.ts
  • scripts/terminal-input-regression.ts
  • scripts/touch-long-press-demo-regression.ts
  • scripts/ui-regression.ts
  • src/components/ChatView.tsx
  • 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
QA (code-review agent's 5-row matrix; artifacts kept) PASS -
Code review (omo-native-code-reviewer, programming + remove-ai-slops) PASS (CLEAR) -
Gate review (another model) APPROVE HIGH

QA

  • The conventions tests pass 18/18, and scripts/fixed-sleeps.json matches the real counts and only goes down.
  • The typecheck passes.
  • prompt-dock-demo-regression gets 28 PASS, including "a restarted poll counts the failed reads before it". With ChatView.tsx reverted to main, that case times out.
  • terminal-input-regression passes.

Behaviour

  • The failed-read count now lives in a ref. It carries across a refused answer or the page being shown again.
  • A read that answers, or a genuine stop, resets it. Reads from a cancelled poll change nothing.
  • There is no new UI.

Fixed-wait markers

  • The gate checked 12 of the // fixed wait: markers directly; the code reviewer read all of them. Each one marks a wait that proves absence.
  • Waits that come before a positive check stay counted.
  • The diff adds 51 markers, not the 39 the first report said.

Follow-ups (LOW)

  • The assert right after the new until(...) in terminal-input-regression.ts can no longer fail.
  • A callback error after a successful read is counted as a failed read. This predates the PR.

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

CodeRabbit did not review this PR (rate-limited or skipped). The reviews above stand in for it.

@devswha
devswha merged commit e3b3982 into main Oct 24, 2026
14 of 16 checks passed
@devswha
devswha deleted the fix/prompt-stale-notice-followups-v2 branch October 24, 2026 19:00
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.

1 participant