Skip to content

fix(ui): clear unread state after overlapping read acknowledgments - #174795

Closed
roboclaw-bot wants to merge 4 commits into
mainfrom
openclaw/aged-supersession-recheck
Closed

roboclaw-bot wants to merge 4 commits into
mainfrom
openclaw/aged-supersession-recheck

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #148262

What Problem This Solves

Fixes: an open conversation can stay unread when newer activity arrives before an earlier read acknowledgment finishes.

User Impact

The visible conversation acknowledges newer activity after a successful earlier read. Hidden tabs and reconnecting conversations wait until their transcript is presented. Manual unread reminders, access checks, and paced retries during Gateway drains remain unchanged. No migration or user action is required.

Why This Change Was Made

Session row reconciliation publishes before the acknowledgment promise settles. Release the current parent acknowledgment before reconsidering the selected row through the existing visibility/history admission owner. Hidden-run acknowledgments retain their revision-scoped success latch; failed and unsent writes retain existing retry behavior.

This carries forward the remaining behavior and mounted admission regression from the original proposal without replacing the later drain-storm fix. The visibility-return callback now lives beside the session read owner rather than in lifecycle setup. No new state owner, scheduler, or retry mechanism was added.

Evidence

  • Mounted production pane, real session capability, and synthetic Gateway I/O: all three visible/hidden-tab/reconnect-history cases failed on baseline efe05bcb8b39d7705f6ee5d7767203afced0534f and pass with the repair. This is boundary proof, not live-deployment qualification.
  • Current head 8fe7bd7b03330154812e8266f598deeb291cb915 merges main b1066a5c49101f28f3cbe4bfd3ca42bc66758036 to resolve actual conflicts. It preserves main’s owner-driven presentation and consolidated tests; no retired redraw path was restored.
  • 62 focused tests pass across mounted admission, deferred hydration, unread guard, read markers, connection lifecycle, and suspension (23.8 seconds command wall time). The history fixture records its actual committed scope and leaves an unreconciled synthetic read pending.
  • Both Mermaid browser E2E cases pass on the current head (21.0 seconds test time; 45.2 seconds command wall time). CI run 38985310940 failed because the test’s manual reload raced automatic lazy-chunk recovery. The fixture now holds the document probe offline during failure assertions, restores reachability, and waits for automatic recovery; the classic-frame case retains manual reload. No retries, timeout increases, or weakened assertions were added.
  • Production UI types, targeted type-aware lint on all seven TypeScript files, formatting, and whitespace checks pass. Fresh independent Codex P0–P2 review of the complete conflict-resolved candidate found no actionable defects.
  • Prior evidence remains limited: a guest-control slider-detachment failure did not reproduce and is not claimed fixed. A pre-refresh local core-test typecheck passed twelve shards then the TypeScript-Go services checker crashed with concurrent map writes; it was not rerun for green or hidden. The refreshed production UI typecheck passes after a normal frozen dependency install. Full current-head CI remains required.
  • Behavior-only production change: no rendered markup or styles changed. Native preparation binds the current head with pending GitHub gates. The original auto request is confirmed retired; no gate waiver or merge is claimed.

Credit: @steipete for the original fix and mounted admission regression.

Work sessions

@clawsweeper

clawsweeper Bot commented Oct 16, 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.

@roboclaw-bot roboclaw-bot added the ci:full Keep ordinary native-locale CI selection on the next PR run. label Oct 16, 2026
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui size: M labels Oct 16, 2026
@roboclaw-bot
roboclaw-bot marked this pull request as ready for review October 16, 2026 22:42
@roboclaw-bot
roboclaw-bot enabled auto-merge (squash) October 16, 2026 22:48
@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. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed 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 16, 2026
@clawsweeper

clawsweeper Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR rechecks newer unread activity after successful read acknowledgments, subject to conversation visibility and history readiness.

Example: Activity at revision 40 arrives while the visible conversation awaits a read receipt covering revision 30.

  • Before: The successful receipt can leave the conversation unread without another acknowledgment.
  • After: The current acknowledgment settles, then the visible, history-ready conversation acknowledges revision 40.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused, useful repair with meaningful production-owner regressions; confidence in the changed behavior rests on an in-process harness rather than shipped-entry-point evidence.
Proof confidence 🦐 gold shrimp (3/6) The ordinary contributor-proof gate does not apply to this collaborator-authored bot PR; its changed settlement behavior has mounted production-owner coverage with synthetic Gateway I/O, while the inspected linked screenshots cover older rejection behavior.
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 its unread indicator when newer activity arrives before an earlier read acknowledgment settles.
Reason: The behavior violates the existing automatic-read contract, and the maintainer-authored PR repairs it through existing owners.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep this PR open: it repairs a current unread-state bug, preserves the drain retry guard, and addresses the earlier hydration-fixture finding; no concrete introduced code defect was found.

Priority: P2
Reviewed head: 8fe7bd7b03330154812e8266f598deeb291cb915

Before merge

Findings

None.

Tests

  • Missing end-to-end proof: The supplied mounted-pane proof covers the changed path, but no shipped-browser trace demonstrates overlapping successful acknowledgments and their visibility/history resume.
Agent review details

How this fits together

The Control UI chat owner consumes Gateway session rows and sends conditional read acknowledgments through the session capability, which reconciles optimistic state and committed receipts into sidebar indicators.

flowchart TD
  A[Gateway session activity] --> B[Session capability]
  B --> C[Selected conversation]
  C --> D[Visibility and history admission]
  D --> E[Unread request guard]
  E --> F[Conditional read acknowledgment]
  F --> B
Loading

Technical review

Best possible solution:

Retain the focused settlement repair in the existing unread and admission owners while preserving manual reminders, access checks, and drain backoff.

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

Source establishes the missed-settlement path, and the supplied mounted-pane regressions cover visible, hidden-document, and reconnect-history cases with reported baseline failures; this read-only review did not execute them.

Is this the best way to solve the issue?

The patch is a small owner-level repair: it reuses existing admission, removes the displaced visibility callback, and adds no competing state owner or retry mechanism.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Pending acknowledgment settlement and drain retries keeps the original intent (06dc2c0: Keep requests pending through optimistic rollback and pace transient failures during Gateway drains.)
  • Manual unread markers and history-gated acknowledgment keeps the original intent (44d60a2: Protect newer manual unread reminders and acknowledge conversations after history admission.)
  • Visibility-return metadata work keeps the original intent (80e086f: Hidden retained panes defer background metadata work until presented.)
  • Mermaid failure and recovery assertions keeps the original intent (01d4b64: Distinguish renderer loading failures from invalid diagram syntax and retain readable source during failure.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 06dc2c0 adds ui/src/lib/sessions/unread.ts:15 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 06dc2c0d64d2; files: ui/src/lib/sessions/unread.ts)
  • Vyctor H. Brzezowski: Raw commit 96d248e adds ui/src/lib/sessions/unread.ts:37 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 96d248ec8689; files: ui/src/lib/sessions/unread.ts)
  • RoboClaw: Raw commit 44d60a2 adds ui/src/lib/sessions/unread.ts:9 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 44d60a29e666; files: ui/src/lib/sessions/unread.ts)

PR surface

Source +23, Tests +171, Docs +6. Total +200 across 8 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 3 40 17 +23
Tests 4 176 5 +171
Docs 1 6 0 +6
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 8 222 22 +200

Labels

Label changes:

No label changes.

Label justifications:

  • P2: The bug leaves a visible conversation's unread indicator stale without demonstrated message loss or runtime unavailability.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Capture a browser request trace showing newer activity acknowledged after the earlier receipt, including deferred acknowledgment while hidden or reconnecting.

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 (1 earlier review cycle)
  • reviewed 2026-10-16T23:00:08.878Z sha 2d7af78ed44a33ac6ff14a2e9fb34190706aeb16 :: needs changes before merge. :: [P2] Update the hydration fixture for the new history admission gate

Reviewed October 18, 2026, 5:40 PM ET / 21:40 UTC (Revision 2).

@roboclaw-bot
roboclaw-bot disabled auto-merge October 16, 2026 23:46
@roboclaw-bot
roboclaw-bot force-pushed the openclaw/aged-supersession-recheck branch from 6805052 to 23255c5 Compare October 16, 2026 23:52
@roboclaw-bot
roboclaw-bot force-pushed the openclaw/aged-supersession-recheck branch from 23255c5 to 26f942c Compare October 17, 2026 00:12
@clawsweeper clawsweeper Bot removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 17, 2026
roboclaw-bot and others added 2 commits October 18, 2026 21:22
Hold the document probe until renderer-failure assertions finish, then wait for automatic lazy-chunk recovery instead of racing it with a manual reload. Preserve manual recovery coverage for classic frame scripts.

Co-authored-by: steipete <[email protected]>
Preserve owner-driven presentation and the consolidated hydration/read-marker fixtures. Remove the retired redraw call and carry accepted-history plus pending-read behavior into the current test owners.

Co-authored-by: steipete <[email protected]>
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 18, 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. labels Oct 18, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed 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 18, 2026
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Closing as superseded.

Superseded by #148262 for overlapping read acknowledgments, including newer activity, hidden tabs and reconnect history. The separate Mermaid lazy-load test-harness repair in this branch remains a useful standalone follow-up; it is not an unfinished unread-state fix and is not claimed to have landed.

This closes the PR without deleting its branch.

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 ci:full Keep ordinary native-locale CI selection on the next PR run. docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: M status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant