Skip to content

fix(ui): preserve session identity across gateway snapshots - #113322

Merged
steipete merged 5 commits into
openclaw:mainfrom
fr-meyer:fix/control-ui-session-identity-fallback
Jul 24, 2026
Merged

steipete merged 5 commits into
openclaw:mainfrom
fr-meyer:fix/control-ui-session-identity-fallback

Conversation

@fr-meyer

@fr-meyer fr-meyer commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

Related: #98742

What Problem This Solves

Fixes an issue where users creating a new Control UI session from a split view could see the assistant identity revert to the generic "Assistant" label after ordinary Gateway snapshots, even after a session-specific identity had loaded.

Why This Change Was Made

The Control UI now preserves the identity loaded for the active session across ordinary Gateway snapshots. It resets to the configured fallback only when the logical connection changes, while the existing startup path reloads the active session identity.

This is a separate Control UI state-preservation path from the gateway session-title fallback addressed by #98841.

The maintainer takeover rebased the contributor commits onto current main, corrected the logical-connection regression fixture to use an actual reconnecting snapshot, and moved the new pane coverage into a dedicated isolated test module so the change does not extend or suppress the grandfathered oversized chat-pane test file.

User Impact

Creating or switching to a session from split view no longer loses the session-specific assistant identity during normal Gateway updates.

Evidence

  • node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-isolated.config.ts --configLoader runner — 8 files and 88 tests passed.
  • node scripts/run-vitest.mjs ui/src/pages/chat/chat-state.test.ts — 45 tests passed.
  • node scripts/check-changed.mjs -- test/vitest/vitest.ui.config.ts ui/src/pages/chat/chat-pane-identity.test.ts ui/src/pages/chat/chat-pane.ts ui/src/pages/chat/chat-state.test.ts — passed on Blacksmith Testbox run https://github.com/openclaw/openclaw/actions/runs/30116354182, including max-lines, formatting, i18n, three typecheck lanes, repository lint, and script guards.
  • .agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main — clean on the final rebased head.
  • git diff --check — clean.
  • Regression coverage proves ordinary-snapshot preservation, logical-connection fallback reset, and loading the current session identity after a same-client route switch.

ClawSweeper proof note

The requested transition coverage is now complete and the contributor reported a manual split-view reproduction. A screenshot or static recording is not attached because it cannot independently prove that an ordinary internal Gateway snapshot occurred; the focused state-transition tests deterministically exercise that exact event plus both reset/reload boundaries. The final head was refreshed against current main and passed the full hosted changed gate.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. labels Jul 24, 2026
@clawsweeper

clawsweeper Bot commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 24, 2026, 8:38 AM ET / 12:38 UTC.

ClawSweeper review

What this changes

The PR stops ordinary Gateway snapshots from replacing the active Control UI session’s assistant identity with the configured fallback, while retaining fallback reset when the logical connection changes.

Merge readiness

⛔ Blocked until real behavior proof is added - 4 items remain

Keep this PR open for a normal maintainer review. The proposed change is a focused Control UI state-preservation fix, but the supplied manual-verification statement is not inspectable after-fix evidence, and the changed reset condition needs proof that both ordinary snapshots and logical connection/session changes retain the intended identity behavior.

Priority: P2
Reviewed head: a2673a3b67255e8aa07807bfa96b0d4d35980d6d

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The patch is narrowly scoped and has a focused test, but the required real browser behavior proof is absent and the relevant identity-transition boundary remains unproven.
Proof confidence 🧂 unranked krab (1/6) Needs real behavior proof before merge: The PR body claims manual split-view verification, but it contains no inspectable recording, screenshot, redacted logs, terminal output, or linked artifact showing the after-fix behavior. Please add redacted visible proof; updating the PR body should trigger a fresh ClawSweeper review, or a maintainer can request one with @clawsweeper re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The PR body claims manual split-view verification, but it contains no inspectable recording, screenshot, redacted logs, terminal output, or linked artifact showing the after-fix behavior. Please add redacted visible proof; updating the PR body should trigger a fresh ClawSweeper review, or a maintainer can request one with @clawsweeper re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 4 items Proposed state-preservation change: The supplied PR diff changes the Gateway-snapshot handler so assistantName is reset to the configured fallback only when sourceChanged is true, with an accompanying regression test for an ordinary connected snapshot.
Adjacent prior fix is distinct: Merged PR #98841 added session-label fallback behavior in gateway title derivation. This PR describes a separate Control UI assistant-identity lifecycle path, so that merged change does not supersede this work.
Proof gap: The PR body reports a manual split-view reproduction, but provides no recording, screenshot, redacted runtime output, logs, or linked artifact that visibly demonstrates the before/after Control UI identity behavior.
Findings None None.
Security None None.

How this fits together

The Control UI receives Gateway snapshots and stores connection state plus the assistant identity displayed for the active chat session. Session-specific identity is loaded separately, and this snapshot handler decides when the UI should preserve it or revert to configured identity defaults.

flowchart LR
  A[Gateway snapshot] --> B[Control UI chat pane]
  C[Session identity loader] --> B
  B --> D{Logical connection changed?}
  D -->|No| E[Keep session assistant identity]
  D -->|Yes| F[Use configured fallback identity]
  E --> G[Chat header and messages]
  F --> G
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The PR body claims manual split-view verification, but it contains no inspectable recording, screenshot, redacted logs, terminal output, or linked artifact showing the after-fix behavior. Please add redacted visible proof; updating the PR body should trigger a fresh ClawSweeper review, or a maintainer can request one with @clawsweeper re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P2) - The patch changes when the UI clears session-derived identity; before merge, prove that a logical connection change still resets to the configured fallback and that a same-client session switch reloads the new session identity rather than retaining the prior session’s name.
  • Resolve merge risk (P1) - The PR needs inspectable after-fix real behavior proof for the split-view create-session path; the body’s unaccompanied manual-verification claim is not sufficient evidence for a browser UI state change.
  • Complete next step (P2) - This is an active contributor PR whose remaining blocker is contributor-provided real UI evidence and lifecycle validation, not a safe automated repair.
Agent review details

Security

None.

PR surface

Source +6, Tests +17. Total +23 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 7 1 +6
Tests 1 17 0 +17
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 24 1 +23

Review metrics

None.

Mantis proof suggestion

A short Control UI chat proof of split-view session creation and an ordinary Gateway snapshot would directly demonstrate the user-visible state change. A maintainer can ask Mantis to capture proof by posting this exact PR comment:

@openclaw-mantis web UI chat proof: reproduce split-view session creation, capture an ordinary Gateway snapshot update, and verify the active session-specific assistant identity remains visible.

Merge-risk options

Maintainer options:

  1. Prove both identity transitions (recommended)
    Add focused coverage for the connection-change fallback and same-client session reload behavior, then attach a redacted split-view recording or diagnostic output showing the active session identity remains stable across an ordinary Gateway snapshot.
  2. Pause for lifecycle confirmation
    Pause this PR if the intended boundary for identity refresh is not clearly the existing logical-connection transition, because preserving a prior session identity through a session switch would mis-associate UI state.

Technical review

Best possible solution:

Keep session identity as the authoritative UI value across ordinary snapshots, reset it only at the verified connection boundary, and add visible split-view evidence plus focused coverage for both preserve and reset/reload paths.

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

No high-confidence live reproduction was independently established. The supplied diff and focused regression test make the ordinary-snapshot path source-reproducible, but the actual split-view flow and reset/reload boundaries still need observable verification.

Is this the best way to solve the issue?

Unclear. Guarding the configured fallback assignment with the existing logical-connection change condition is a narrow solution, but it is only the best fix if session switches on an unchanged connection reliably refresh the active session identity afterward.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: This is a bounded Control UI session-state regression with user-visible identity confusion but no evidence of data loss, security exposure, or an unusable runtime.
  • add merge-risk: 🚨 session-state: The patch changes the lifecycle boundary that clears and preserves the assistant identity, so an incomplete reload path could display one session’s identity for another session.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body claims manual split-view verification, but it contains no inspectable recording, screenshot, redacted logs, terminal output, or linked artifact showing the after-fix behavior. Please add redacted visible proof; updating the PR body should trigger a fresh ClawSweeper review, or a maintainer can request one with @clawsweeper re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Label justifications:

  • P2: This is a bounded Control UI session-state regression with user-visible identity confusion but no evidence of data loss, security exposure, or an unusable runtime.
  • merge-risk: 🚨 session-state: The patch changes the lifecycle boundary that clears and preserves the assistant identity, so an incomplete reload path could display one session’s identity for another session.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body claims manual split-view verification, but it contains no inspectable recording, screenshot, redacted logs, terminal output, or linked artifact showing the after-fix behavior. Please add redacted visible proof; updating the PR body should trigger a fresh ClawSweeper review, or a maintainer can request one with @clawsweeper re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

  • Proposed state-preservation change: The supplied PR diff changes the Gateway-snapshot handler so assistantName is reset to the configured fallback only when sourceChanged is true, with an accompanying regression test for an ordinary connected snapshot. (ui/src/pages/chat/chat-pane.ts:3311, a2673a3b6725)
  • Adjacent prior fix is distinct: Merged PR fix(gateway): include session label in deriveSessionTitle fallback chain #98841 added session-label fallback behavior in gateway title derivation. This PR describes a separate Control UI assistant-identity lifecycle path, so that merged change does not supersede this work. (68e06b9ea148)
  • Proof gap: The PR body reports a manual split-view reproduction, but provides no recording, screenshot, redacted runtime output, logs, or linked artifact that visibly demonstrates the before/after Control UI identity behavior. (a2673a3b6725)
  • Repository inspection limitation: A read-only command attempt failed before repository files, scoped UI policy, current-main callers, tests, and git history could be inspected; conclusions therefore rely on the supplied PR context and diff rather than a completed source/history audit.

Likely related people:

  • SunnyShu0925: Authored the merged gateway session-label fallback work in the related history, which is adjacent to but not the same as this Control UI identity-preservation path. (role: adjacent session-display contributor; confidence: low; commits: 68e06b9ea148; files: src/gateway/session-utils.ts)

Rank-up moves

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

  • Attach a redacted recording or screenshots that show split view creating or switching sessions, an ordinary Gateway update, and the session-specific assistant identity remaining visible.
  • Add focused regression coverage for the logical connection-change reset and the active-session reload behavior.

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.

@fr-meyer

Copy link
Copy Markdown
Contributor Author

@openclaw-mantis web UI chat proof: reproduce split-view session creation, capture an ordinary Gateway snapshot update, and verify the active session-specific assistant identity remains visible.

@steipete steipete self-assigned this Jul 24, 2026
@steipete
steipete force-pushed the fix/control-ui-session-identity-fallback branch 4 times, most recently from 3ab73f7 to 5417904 Compare July 24, 2026 19:35
fr-meyer and others added 5 commits July 24, 2026 15:58
Co-authored-by: openclaw-repo-broker[bot] <285669409+openclaw-repo-broker[bot]@users.noreply.github.com>
Co-authored-by: openclaw-repo-broker[bot] <285669409+openclaw-repo-broker[bot]@users.noreply.github.com>
@steipete
steipete force-pushed the fix/control-ui-session-identity-fallback branch from 5417904 to 64f6a97 Compare July 24, 2026 19:59
@steipete
steipete merged commit 5e3007c into openclaw:main Jul 24, 2026
99 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 25, 2026
…#113322)

* fix(ui): preserve session identity across gateway snapshots

Co-authored-by: openclaw-repo-broker[bot] <285669409+openclaw-repo-broker[bot]@users.noreply.github.com>

* test(ui): cover session identity transitions

Co-authored-by: openclaw-repo-broker[bot] <285669409+openclaw-repo-broker[bot]@users.noreply.github.com>

* test(ui): model identity reconnect snapshot accurately

* style(ui): format session identity test import

* test(ui): isolate assistant identity snapshot coverage

---------

Co-authored-by: openclaw-repo-broker[bot] <285669409+openclaw-repo-broker[bot]@users.noreply.github.com>
Co-authored-by: Peter Steinberger <[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 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: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants