Skip to content

fix(ui): acknowledge newer activity after pending reads settle - #148262

Merged
steipete merged 1 commit into
mainfrom
codex/ui-unread-ack-lifecycle-20260914
Oct 21, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/ui-unread-ack-lifecycle-20260914

Conversation

@steipete

@steipete steipete commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes: an open chat can keep a stuck unread badge when newer activity arrives during an automatic read acknowledgement.

User Impact

User impact: newer activity is acknowledged once the pending read succeeds and the chat is visible with its history ready. Returning to a hidden tab or reconnecting resumes the deferred read. Manual unread reminders, access restrictions, and failure backoff keep their existing behavior.

Why This Change Was Made

On main, ui/src/pages/chat/chat-pane-session.ts:388 only settles the request. The guard also overwrites its observed read at ui/src/lib/sessions/unread.ts:48, so newer activity can remain suppressed after success. Preserve the observation for that pending request and reconsider the selected row after current successful settlement, through the existing secondarySessionReadsReady admission owner. Visibility return uses that same path.

This revision keeps main's request ownership, retry policy, hidden-run handling, and receipt reconciliation. It discards the old PR's already-landed guard and attention-receipt rewrites. Production +21/-4 (net +17); tests +271/-1 (net +270); docs +2. The added production code connects successful settlement to the existing read owner without another state machine.

Evidence

  • Rebuilt on main a6b339e1c4d6bc238ed20620204f55311dcfdb0b. Base: 4 owner failures / 10 passes; visible and hidden settlement miss the follow-up, reconnect acknowledges before replacement history, and the guard stays latched. The rejection control already passes.
  • Bundled Chromium reproduces the same missing second acknowledgement on base: activity revision 40 arrives during an acknowledgement whose receipt is revision 30; the badge stays visible and only one request is sent. Base browser run 116.22s including build and failure diagnostics.
  • Fixed: 41 focused owner checks pass, including existing access, retry, manual-marker, and hidden-run cases. The mounted four-case file uses under 2s of test execution; the combined owner run took 25.29s, and the isolated read-marker file 30.47s including module setup.
  • All 8 unread browser cases pass, 89.51s including the production bundle; the new scenario takes 3.02s. This checks the rendered badge and exactly two total requests through the production UI and real session capability; helper-only assertions cannot prove that boundary.
  • Changed-file lint, formatting, and diff checks pass. Independent Codex autoreview is clean for P0–P2 findings; the only post-review change renames two shadowed test locals without changing behavior.
  • Synthetic mocked Gateway only. No live Gateway, real session, or model was used; broad validation belongs to exact-head PR CI under this lane's proof budget.

Before: newer activity leaves the active chat unread after the older acknowledgement succeeds.

Before: stuck unread badge after acknowledgement settlement

After: one deferred acknowledgement clears the badge.

After: unread badge clears after the deferred acknowledgement

Exact-head CI 39566907178 passed on 68323cd5bcc6bdb8b3dfbf75901d357ad8153076, including the UI, browser, core lint, and type checks. The final cross-workflow inspection also shows successful security and CI gates; no failure rerun was needed. Fresh ClawSweeper review on this head found zero issues and inspected the replacement screenshots. The review notes overlapping PR #174795 for the maintainer's landing decision.

@clawsweeper

clawsweeper Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@steipete
steipete marked this pull request as ready for review September 14, 2026 13:02
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: M maintainer Maintainer-authored PR labels Sep 14, 2026
@steipete steipete closed this Sep 14, 2026
@steipete steipete reopened this Sep 14, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 17, 2026
@clawsweeper

clawsweeper Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Reconsider newer unread activity after a pending read succeeds, waiting until the conversation is visible and its history is ready.

Example: Activity revision 40 arrives while a read acknowledgement returning revision 30 is pending.

  • Before: Only one acknowledgement is sent, leaving the open conversation's unread badge visible.
  • After: A second acknowledgement clears the badge once the conversation is visible and ready.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Focused repair with no actionable defect found; inspected UI captures support the result, while execution evidence remains bounded to synthetic Gateway scenarios.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR is outside the ordinary contributor proof gate; inspected screenshots show the production UI badge before and after the repair, while the supplied mounted and bundled-browser scenarios use synthetic Gateway I/O and establish no live Gateway or model result.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: An open conversation can retain an unread badge after newer activity arrives during a pending automatic read.
Reason: The maintainer-authored direction restores expected read behavior while preserving manual reminders, access restrictions, and paced failure handling.

Merge readiness

✅ Ready for maintainer review

Keep open: this PR addresses a current unread-acknowledgement bug with a focused change, and I found no introduced correctness or security defect; exact-head CI remains pending.

Priority: P2
Reviewed head: 68323cd5bcc6bdb8b3dfbf75901d357ad8153076

Before merge

None.

Findings

None.

Agent review details

How this fits together

The Control UI chat pane consumes session-row publications, admits automatic reads through its visibility/history owner, and sends sessions.patch requests through the shared session capability.

flowchart LR
  A[Session activity] --> B[Session capability]
  B --> C[Selected chat row]
  C --> D[Visibility and history admission]
  D --> E[Unread patch guard]
  E --> F[Gateway read acknowledgement]
  F --> B
Loading

Technical review

Best possible solution:

Preserve request-scoped read observations and reconsider the selected row through the existing visibility/history admission owner after current successful settlement.

Do we have a high-confidence way to reproduce the issue?

The base source exposes the missed follow-up path, and the PR supplies matching baseline failures and before/after browser captures; this review ran no target code.

Is this the best way to solve the issue?

The diff is a small complete repair for the demonstrated scenario: it reuses the existing guard, admission owner, mutation capability, and visibility listener without adding another scheduler or state owner.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against b9ea0a58716f.

Provenance checked

  • Pending read observation and settlement changes intended behavior with a stated reason (06dc2c0: Prevent synchronous optimistic rollback from creating acknowledgement storms during Gateway drains.)
  • Manual unread reminders keeps the original intent (44d60a2: Keep a newer explicit unread reminder intact while its conversation remains open.)
  • Deferred secondary hydration keeps the original intent (e154330: Keep secondary reads behind transcript commitment and preserve session and connection ownership.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • RoboClaw: Raw commit 44d60a2 adds ui/src/lib/sessions/unread.ts:33 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 44d60a29e666; files: ui/src/lib/sessions/unread.ts)

PR surface

Source +17, Tests +270, Docs +2. Total +289 across 9 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 3 21 4 +17
Tests 5 271 1 +270
Docs 1 2 0 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 9 294 5 +289

Review metrics

Metric Value Why it matters
Production versus test LOC Production +21/-4; tests +271/-1 Production growth reconnects existing owners; test growth covers settlement, hidden-tab resume, reconnect admission, and the rendered badge.

Labels

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • remove proof: sufficient: Current real behavior proof status is not_applicable, not sufficient.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.

Label justifications:

  • P2: A stuck unread badge is a bounded Control UI state bug with a focused repair.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (9 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-18T03:32:30.469Z sha a6f7ce1 :: blocked before merge. :: none
  • reviewed 2026-09-21T10:52:29.102Z sha b13b2f7 :: needs changes before merge. :: none
  • reviewed 2026-09-21T13:23:17.296Z sha bcb1c68 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-21T13:48:58.146Z sha bcb1c68 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-21T17:00:01.591Z sha 4cecfe0 :: needs maintainer review before merge. :: none
  • reviewed September 27, 2026, 7:50 PM ET / 23:50 UTC (Revision 7) sha unknown :: blocked before merge. :: none
  • reviewed 2026-10-05T17:52:57.666Z sha 4cecfe0 :: blocked before merge. :: none
  • reviewed 2026-10-05T17:59:58.591Z sha 4cecfe0 :: blocked before merge. :: none

Reviewed October 21, 2026, 4:15 AM ET / 08:15 UTC (Revision 10).

@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Sep 18, 2026
@steipete
steipete requested a review from a team as a code owner September 21, 2026 10:44
@steipete steipete self-assigned this Sep 21, 2026
@steipete
steipete requested a review from a team as a code owner September 21, 2026 10:44
@steipete steipete changed the title fix(ui): stop repeated unread acknowledgements after rejection fix(ui): settle automatic unread acknowledgements Sep 21, 2026
@clawsweeper clawsweeper Bot removed proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. labels Sep 21, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. labels Sep 21, 2026
@steipete steipete closed this Sep 21, 2026
@steipete steipete reopened this Sep 21, 2026
@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Sep 28, 2026
Reconsider the selected session after a successful read acknowledgement, using existing visibility and transcript readiness. Preserve request ownership, rejection backoff, manual unread markers and hidden-run policy. Verify newer activity, hidden tabs and reconnect history through the production session capability and bundled UI.
@steipete
steipete force-pushed the codex/ui-unread-ack-lifecycle-20260914 branch from 4cecfe0 to 68323cd Compare October 21, 2026 08:07
@steipete steipete changed the title fix(ui): settle automatic unread acknowledgements fix(ui): acknowledge newer activity after pending reads settle Oct 21, 2026
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: M and removed size: L labels Oct 21, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 21, 2026
@steipete
steipete merged commit d8053dd into main Oct 21, 2026
123 of 128 checks passed
@steipete
steipete deleted the codex/ui-unread-ack-lifecycle-20260914 branch October 21, 2026 19:00
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 22, 2026
…law#148262)

Reconsider the selected session after a successful read acknowledgement, using existing visibility and transcript readiness. Preserve request ownership, rejection backoff, manual unread markers and hidden-run policy. Verify newer activity, hidden tabs and reconnect history through the production session capability and bundled UI.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui docs Improvements or additions to documentation maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant