Skip to content

fix: refresh visible shared Gateway conversations - #201076

Merged
vincentkoc merged 2 commits into
mainfrom
fix/session-share-visible-polling-20261118
Nov 18, 2026
Merged

vincentkoc merged 2 commits into
mainfrom
fix/session-share-visible-polling-20261118

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

What Problem This Solves

A shared Gateway transcript can remain stale while its source conversation continues.

User Impact

A selected read-only Gateway transcript refreshes every five seconds while visible. Existing history is retained when pages overlap; a reset or gap replaces the window. Hiding or disconnecting the pane retires pending reads.

Why This Change Was Made

Adds a single-flight polling lifetime to the existing catalog view, including recovery from initial absence and unavailable sessions. It does not add write or steering authority and does not change visual layout.

Evidence

The polling candidate passed 43 tests across four files, UI typechecking, lint and configuration checks. Tests cover page overlap/gaps, visibility, disconnects and recovery. Independent exact-slice review accepted publication.

The complete cumulative tree is byte-identical to the frozen tree that passed pnpm build in 7m 6.3s; this is exact-tree proof reuse, not a claim that full build ran on every slice. Advisory UI size-budget violations also reproduced on the host-only tree without polling. Budgets were not changed; existing Solid lint/test diagnostics remain.

No steering or reader write privilege is included. No live deployment was performed.

Exact revision and proof entry points
  • Reviewed head: 1724c1557ec3197113eae540971f9cede4ec1dac
  • Reviewed base: c4658d819fe006ebc2051d3b012f6a4ba458d258
  • Tree: af3032f4dcdfc7f990dfaf74e1621c1a2846f440
  • Delta: 5 files, +610/−247.

Focused runs used node scripts/run-vitest.mjs with isolated repository-suite configurations, maxWorkers: 1 and file parallelism disabled, selecting:

  • ui/src/pages/chat/chat-pane-catalog.test.ts
  • ui/src/pages/chat/chat-pane-catalog-disconnect.test.ts
  • ui/src/pages/chat/chat-pane-catalog-poll.test.ts
  • ui/src/pages/chat/chat-pane-catalog-terminal.test.ts

Full-build command: pnpm build (host-only tree for slice 1; identical cumulative frozen tree for slice 4).

Stack order

4/4. Depends on the preceding PR (feat/session-share-outbound-reader-20261118). Merge prerequisites before retargeting/revalidating this exact diff; do not merge this stack out of order.

Depends on #201075.

@clawsweeper

clawsweeper Bot commented Nov 18, 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.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui plugin: session-share size: L labels Nov 18, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review November 18, 2026 07:47
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug 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: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. 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-repro Preliminary submission classification; full source review pending. labels Nov 18, 2026
@clawsweeper

clawsweeper Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

Refreshes visible outbound shared Gateway transcripts every five seconds while preserving overlapping history and retiring obsolete reads.

Example: A viewer opens the Team Gateway conversation while its source continues.

  • Before: New replies remain absent until the transcript is reopened or refreshed.
  • After: The visible transcript periodically retrieves new replies without reopening.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The product improvement is worthwhile, but the pagination defect and validation state prevent approval.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🦪 silver shellfish (2/6) 1 actionable review finding remain.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: A selected shared Gateway transcript remains stale while the source conversation continues.
Reason: Automatic refresh has clear value for an existing read-only view, and the maintainer-authored PR establishes direction without adding configuration or write authority.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep this useful maintainer-authored PR open; its polling reconciliation needs one pagination correction before merge.

Priority: P2
Reviewed head: 1724c1557ec3197113eae540971f9cede4ec1dac

Before merge

  • Invalidate retained pagination when the source rewinds (P2) - An overlapping first message does not mean the old cursor is still valid. For example, load history through message 150 with an older cursor anchored at 150, then rewind the source to message 140. The next latest page contains messages 91–140, so message 91 overlaps and retainedHistory becomes true. The code updates the displayed tail but keeps the cursor anchored at 150. The next older read is rejected by readCatalogPageFromEntry because its anchor exceeds the current transcript length, and subsequent polls keep preserving that invalid cursor. Recognize this non-append transition and adopt the fresh window/cursor, with a regression covering older navigation after rewind.

Findings

  • [P2] Invalidate retained pagination when the source rewinds — ui/src/pages/chat/chat-pane-catalog.ts:247-251

Tests

  • Missing end-to-end proof: Provide redacted browser recording or Gateway-backed logs showing source replies refreshing, older-history navigation, and hide/reveal or reconnect recovery; the supplied evidence also does not show a base-red/head-green behavioral regression run.
Agent review details

How this fits together

The Control UI catalog reader retrieves session metadata and transcript pages through Gateway RPC, then publishes messages and pagination state to the retained chat pane.

flowchart LR
  A[Visible chat pane] --> B[Visibility timer]
  B --> C[Catalog reader]
  C --> D[Receiver Gateway]
  D --> E[Source Gateway]
  E --> F[Transcript pages]
  F --> C
Loading

Technical review

Best possible solution:

Keep polling in the existing catalog reader, retaining older history and its cursor only for append-compatible windows and replacing both after a rewind or incompatible reset.

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

Source inspection establishes the missing periodic transcript read on current main and the incompatible-cursor path after a source rewind; no target code was executed.

Is this the best way to solve the issue?

Reusing the existing reader, cancellation lifetime, and visibility timer is appropriate, but a single overlapping message does not establish that retained pagination remains valid.

Full review comments:

  • [P2] Invalidate retained pagination when the source rewinds — ui/src/pages/chat/chat-pane-catalog.ts:247-251
    An overlapping first message does not mean the old cursor is still valid. For example, load history through message 150 with an older cursor anchored at 150, then rewind the source to message 140. The next latest page contains messages 91–140, so message 91 overlaps and retainedHistory becomes true. The code updates the displayed tail but keeps the cursor anchored at 150. The next older read is rejected by readCatalogPageFromEntry because its anchor exceeds the current transcript length, and subsequent polls keep preserving that invalid cursor. Recognize this non-append transition and adopt the fresh window/cursor, with a regression covering older navigation after rewind.
    Confidence: 0.96

Overall correctness: patch is incorrect
Overall confidence: 0.94

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

Acceptance criteria:

  • pnpm test ui/src/pages/chat/chat-pane-catalog-poll.test.ts ui/src/pages/chat/chat-pane-catalog.test.ts ui/src/pages/chat/chat-pane-catalog-disconnect.test.ts ui/src/pages/chat/chat-pane-catalog-terminal.test.ts --maxWorkers=1
  • git diff --check

What I checked:

Likely related people:

  • Vincent Koc: Raw commit c147613 adds docs/plugins/session-share.md:10 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: c147613091ca; files: docs/plugins/session-share.md)
  • Peter Steinberger: Raw commit 5278a8f adds docs/plugins/session-share.md:12 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 5278a8f2ed9e; files: docs/plugins/session-share.md)

PR surface

Source +60, Tests +298, Docs +5. Total +363 across 5 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 3 307 247 +60
Tests 1 298 0 +298
Docs 1 5 0 +5
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 610 247 +363

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add P2: This improves a bounded read-only transcript workflow, with a normal-priority pagination defect after source rewinds.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: This improves a bounded read-only transcript workflow, with a normal-priority pagination defect after source rewinds.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

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.

Reviewed November 18, 2026, 3:04 AM ET / 08:04 UTC.

@vincentkoc
vincentkoc force-pushed the feat/session-share-outbound-reader-20261118 branch from c4658d8 to 5d59a9a Compare November 18, 2026 09:36
Base automatically changed from feat/session-share-outbound-reader-20261118 to main November 18, 2026 10:25
@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Security-sensitive guard cleared

Current revision: 12f02200c2efcbf8d5379c183e889ac7eb9331a2

This PR no longer changes files in the maintainer security-review tier.

Separate CODEOWNERS requirements still apply to security policy and enforcement files.

@vincentkoc
vincentkoc merged commit 401d334 into main Nov 18, 2026
87 checks passed
@vincentkoc
vincentkoc deleted the fix/session-share-visible-polling-20261118 branch November 18, 2026 10:44
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 19, 2026
* fix: refresh visible shared Gateway conversations

* fix(ui): reset catalog cursors after transcript rewinds

Co-authored-by: Vincent Koc <[email protected]>
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 P2 Normal backlog priority with limited blast radius. plugin: session-share rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: L 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