Skip to content

fix(ui): keep pinned sidebar pages visible during reconnect - #129517

Merged
steipete merged 1 commit into
mainfrom
fix/pinned-sidebar-reconnect
Aug 25, 2026
Merged

steipete merged 1 commit into
mainfrom
fix/pinned-sidebar-reconnect

Conversation

@roboclaw-bot

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Fixes an issue where users with pinned sidebar pages would see every pinned page disappear and then reappear when the Control UI replaced its Gateway client during an offline retry or reconnect.

Why This Change Was Made

The Gateway now exposes an opaque connection revision that advances only when its endpoint or credentials change. The sidebar session-data owner retains its paired session snapshot across replaceable socket clients for the same logical Gateway, waits for the next canonical list revision, and still clears immediately for a different Gateway connection or session capability. This PR is AI-assisted.

User Impact

Pinned pages and the rest of the sidebar session list remain visible while a reconnect is in progress. Once the fresh authoritative session list arrives, real changes such as an unpin are applied normally.

Evidence

  • Pre-fix regression: pnpm test ui/src/components/app-sidebar.test.ts failed because client replacement changed the cached result to null and removed the pinned DOM entry.
  • pnpm test ui/src/app/gateway-store.test.ts ui/src/components/app-sidebar.test.ts — 350 tests passed.
  • node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/session-management.sidebar.e2e.test.ts -t 'transport and client replacement reconnects' — exact browser reconnect regression passed.
  • pnpm check:changed — formatting, guards, dead-export scans, UI/core-test typechecks, and lint passed.
  • .agents/skills/autoreview/scripts/autoreview --mode uncommitted — clean; no accepted/actionable findings.
  • Production delta: +13 net lines. Test and test-support delta: +87 net lines.
  • Before screenshot was not captured from the operator's transient browser state; the pre-fix failing boundary test records the disappearance. The attached after screenshot was inspected and shows the pinned Disconnect proof page retained while the replacement client is offline.

Pinned sidebar remains visible during client replacement

@clawsweeper

clawsweeper Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@roboclaw-bot
roboclaw-bot marked this pull request as ready for review August 25, 2026 18:06
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: S maintainer Maintainer-authored PR labels Aug 25, 2026
@steipete
steipete force-pushed the fix/pinned-sidebar-reconnect branch from 1ae00f4 to 1489543 Compare August 25, 2026 21:58
@steipete

Copy link
Copy Markdown
Contributor

Maintainer takeover-rebase onto current main (clean, no conflicts): both earlier CI attempts on this PR failed on main-carried breakage, not this change — (1) the checks-node-compact 120s "timeout" class introduced by #129052 (the anthropic provider-policy artifact started pulling the provider-auth barrel, forcing dist-less CI workers to jiti-compile ~2.2k modules synchronously; root-cause analysis and fix history in #129558 (comment)), and (2) the stale commands-learn authoring-standards assertions healed by #129370. Both are fixed on current main, so this rebase should let CI attach green.

This fix (gateway-owned connectionRevision, cache retention across socket-client rotation) is complementary to #129150 (projection presentation stability, landed) and #129558 (warm owner-first roster publish + row DOM identity, in flight): three distinct mechanisms behind the team.openclaw.ai sidebar flicker, no shared production files.

@clawsweeper clawsweeper Bot added merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P2 Normal backlog priority with limited blast radius. 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 Aug 25, 2026
@clawsweeper

clawsweeper Bot commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 25, 2026, 6:44 PM ET / 22:44 UTC.

ClawSweeper review

What this changes

The PR retains sidebar session entries across replacement Gateway socket clients for one endpoint/credential set, while clearing them when that logical Gateway connection changes.

Regression provenance

Possible regression — probable (reproduction; reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open for protected-label maintainer review. Current main still clears sidebar state when a reconnect rotates the socket client; this branch adds a logical-connection boundary that preserves it until the next canonical list arrives.

Priority: P2
Reviewed head: 148954390772377732949594891da24be3956ea2
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The owner-boundary fix and exact-head validation are strong, with useful direct UI evidence for the retained sidebar entry.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (screenshot): The PR supplies an after-fix browser screenshot of the pinned entry retained during replacement plus focused browser regression evidence; no sensitive browser-runtime or security claim relies on the image alone.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): The PR supplies an after-fix browser screenshot of the pinned entry retained during replacement plus focused browser regression evidence; no sensitive browser-runtime or security claim relies on the image alone.
Evidence reviewed 6 items Current-main failure mechanism: Current main treats a disconnected replacement socket as a different client, so it publishes the transient null session snapshot instead of retaining the sidebar cache.
Logical connection owner: The branch increments an opaque revision only when the endpoint or authentication-bearing connection fields change, giving the sidebar one owner-provided distinction between a reconnect and a different Gateway.
Sidebar lifetime boundary: The controller retains cache across client rotation but clears it when the Gateway object or connection revision changes.
Findings None None.
Security None None.

Live Verification

Command: node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/session-management.sidebar.e2e.test.ts -t 'transport and client replacement reconnects'

Result: PASS (completed)

RUN  v4.1.10 /tmp/clawsweeper-live-proof-129517-lw5kFA/target

[vitest] still running with no output for 30000ms.
 ✓  ui-e2e  ui/src/e2e/session-management.sidebar.e2e.test.ts (11 tests | 10 skipped) 24474ms
     ✓ keeps sidebar sessions visible through transport and client replacement reconnects  11958ms

 Test Files  1 passed (1)
      Tests  1 passed | 10 skipped (11)
   Start at  22:45:30
   Duration  32.60s (transform 402ms, setup 88ms, import 694ms, tests 24.47s, environment 0ms)
RUN  v4.1.10 /tmp/clawsweeper-live-proof-129517-lw5kFA/target

 ✓  ui-e2e  ui/src/e2e/session-management.sidebar.e2e.test.ts (11 tests | 10 skipped) 4116ms
     ✓ keeps sidebar sessions visible through transport and client replacement reconnects  3940ms

 Test Files  1 passed (1)
      Tests  1 passed | 10 skipped (11)
   Start at  22:46:03
   Duration  10.06s (transform 125ms, setup 41ms, import 431ms, tests 4.12s, environment 0ms)

Assertions:

  • PASS expect_output: transport and client replacement reconnects

How this fits together

The Control UI Gateway store owns endpoint, credential, and socket-client lifecycle. Its session-data controller consumes that state to decide when sidebar session snapshots remain visible or are replaced by canonical Gateway results.

flowchart LR
  A[Gateway endpoint and credentials] --> B[Gateway connection store]
  B --> C[Logical connection revision]
  B --> D[Replaceable socket client]
  C --> E[Sidebar session-data controller]
  D --> E
  E --> F[Canonical session list]
  F --> G[Visible pinned sidebar entries]
Loading

Decision needed

Question Recommendation
Does a maintainer accept the tested logical-Gateway cache-retention boundary for this protected PR? Land after protected-label review: Accept the bounded retention contract because the exact-head regression coverage distinguishes socket rotation from endpoint or credential changes.

Why: The maintainer label requires human handling, and the change intentionally alters when session state is allowed to remain visible during reconnect.

Before merge

  • Resolve merge risk (P1) - The +13 production lines deliberately extend session-cache lifetime across socket rotation; an error in the logical-connection discriminator could temporarily retain rows from a different Gateway, so the endpoint/token-change regression coverage is merge-critical.
Agent review details

Security

None.

PR surface

Source +66, Tests +34. Total +100 across 16 files.

View PR surface stats
Area Files Added Removed Net
Source 7 73 7 +66
Tests 9 36 2 +34
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 16 109 9 +100

Review metrics

Metric Value Why it matters
Production versus test delta production +13 net; tests and test support +87 net The production growth is the single connection-lifetime fact and its consumer; the larger test change covers both retention and invalidation boundaries.

Stored data model

Persistent data-model change detected: serialized state: ui/src/e2e/session-management.sidebar.e2e.test.ts, serialized state: ui/src/test-helpers/app-sidebar-cases/sessions.ts, unknown-data-model-change: ui/src/components/session-data-controller.ts, unknown-data-model-change: ui/src/e2e/session-management.sidebar.e2e.test.ts, unknown-data-model-change: ui/src/test-helpers/app-sidebar-cases/sessions.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Accept the logical-connection boundary (recommended)
    Land with the current revision contract and its distinct client-replacement versus connection-change regressions.
  2. Add live reconnect media
    Capture a redacted Control UI before/after reconnect recording if maintainers require stronger visual confirmation of the retained pinned entry.

Technical review

Best possible solution:

Keep one Gateway-owned logical-connection revision, retain sidebar state only across replacement clients for that revision, and clear it before a different endpoint or credential set can render old rows.

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

Yes: current main’s same-client check becomes false when a reconnect replaces the socket, allowing the null session snapshot to publish; the branch’s focused browser and boundary tests exercise that transition.

Is this the best way to solve the issue?

Yes: recording the connection identity at the Gateway owner and consuming it in the sidebar is narrower and safer than teaching the sidebar to infer connection identity from socket objects.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against b6a2366f6431.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR supplies an after-fix browser screenshot of the pinned entry retained during replacement plus focused browser regression evidence; no sensitive browser-runtime or security claim relies on the image alone.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The PR supplies an after-fix browser screenshot of the pinned entry retained during replacement plus focused browser regression evidence; no sensitive browser-runtime or security claim relies on the image alone.

Label justifications:

  • P2: This is a bounded repair for a visible Control UI sidebar-state regression during reconnect.
  • merge-risk: 🚨 session-state: Merging changes when cached session rows survive socket replacement versus a different logical Gateway connection.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): The PR supplies an after-fix browser screenshot of the pinned entry retained during replacement plus focused browser regression evidence; no sensitive browser-runtime or security claim relies on the image alone.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR supplies an after-fix browser screenshot of the pinned entry retained during replacement plus focused browser regression evidence; no sensitive browser-runtime or security claim relies on the image alone.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The PR supplies an after-fix browser screenshot of the pinned entry retained during replacement plus focused browser regression evidence; no sensitive browser-runtime or security claim relies on the image alone.

Evidence

What I checked:

Likely related people:

  • steipete: Authored the merged sidebar projection work and the current PR’s takeover note distinguishing this reconnect-cache mechanism from adjacent sidebar fixes. (role: recent sidebar-session contributor and takeover reviewer; confidence: high; commits: 7e8412e080e9; files: ui/src/components/session-data-controller.ts, ui/src/components/app-sidebar-session-navigation.ts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-08-25T22:03:13.600Z sha 1489543 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. labels Aug 25, 2026
@steipete

Copy link
Copy Markdown
Contributor

Land-ready. Exact head 14895439077 (takeover-rebase onto healed main) — CI fully green on this head. Both earlier red attempts were main-carried breakage, root-caused and fixed on main (#129052's provider-policy artifact pulling the provider-auth barrel → 120s jiti-compile "timeouts" in dist-less CI workers; stale commands-learn assertions healed by #129370).

My verification on the rebased head: gateway-store, sidebar-management e2e, and app-sidebar suites green locally (the single local failure — transient-menus attention-panel — reproduces identically on clean origin/main in local lanes only; checks-ui is green on this exact head in CI). Fresh independent Codex autoreview (gpt-5.6-sol, high) on the full branch diff: clean, no findings.

Complementary to #129150 (landed) and #129558 (landed): three distinct mechanisms behind the team.openclaw.ai sidebar flicker, no shared production files. ClawSweeper's review worker stalled twice at the placeholder (leases expired unpublished); no findings or rank-up moves exist, and a late re-review refreshes the rating post-merge.

@steipete
steipete merged commit 3cc64f9 into main Aug 25, 2026
122 checks passed
@steipete
steipete deleted the fix/pinned-sidebar-reconnect branch August 25, 2026 23:44
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

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 maintainer Maintainer-authored PR merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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.

2 participants