Skip to content

fix(ui): surface session sharing errors without leaking across chats - #118135

Merged
steipete merged 1 commit into
mainfrom
codex/qa0802-ui-sharing-errors
Aug 2, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/qa0802-ui-sharing-errors

Conversation

@steipete

@steipete steipete commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Preserve session-sharing mutation failures for visibility-only and member-enabled gateways instead of silently closing the menu with no visible result.
  • Publish the error through the canonical chat header owner so an operator still sees it after Web Awesome closes the dropdown.
  • Keep sharing errors scoped to their originating session; stale gateway connections, replaced sessions, and same-connection navigation from chat A to chat B cannot leak an old error into the active chat.
  • Retain the session-local inline failure when the operator reopens the sharing menu.

Root cause and owner boundary

The visibility-only sharing component discarded its error state, and successful connection-scope checks did not establish that the affected session was still the currently selected chat. Sharing failures now flow through one canonical owner that always caches the originating session's error but publishes the global chat header error only when that session remains active. The existing current-connection/current-row guards are preserved. Production delta: +6 lines across the owning chat header/sharing surfaces; no config, protocol, persistence, authorization, or security changes.

Test plan / real behavior evidence

  • Hosted Blacksmith Testbox: node scripts/run-vitest.mjs ui/src/pages/chat/components/chat-session-sharing.test.ts ui/src/pages/chat/chat-pane-sharing.test.ts ui/src/pages/chat/chat-pane.test.ts — 3 suites, 73/73 passing, including both visibility and member failures after switching from chat A to chat B on the same live connection.
  • Real Playwright Chromium, real Vite Control UI, and real websocket-backed gateway interaction: node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/session-ownership.e2e.test.ts -t 'keeps rejected visibility-only sharing changes visible after the menu closes' — 1/1 passing. The browser selects visibility, waits for Web Awesome to close the menu, rejects the actual deferred sharing request, asserts the global [role=alert] is visible, reopens the menu, and asserts the originating session's inline sharing error is visible.
  • Shared isolated Testbox lease / hosted backing run: https://github.com/openclaw/openclaw/actions/runs/30760713254
  • Fresh full-patch gpt-5.6-sol, high-reasoning, P1-threshold structured review: clean, confidence 0.96.
  • Canonical formatting and git diff --check: clean.

No public-channel message or live credentials are used or required.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: S maintainer Maintainer-authored PR labels Aug 2, 2026
@steipete
steipete marked this pull request as ready for review August 2, 2026 19:03
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal backlog priority with limited blast radius. labels Aug 2, 2026
@clawsweeper

clawsweeper Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 2, 2026, 3:07 PM ET / 19:07 UTC.

ClawSweeper review

What this changes

The branch makes rejected session-sharing changes visible after the sharing dropdown closes while preserving per-session errors and preventing a failure from chat A from appearing after navigation to chat B.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep this PR open for explicit maintainer handling. The patch appears correct: it records each sharing failure with its owning session, exposes the failure through the active chat header only when that session is still selected, and makes the inline error visible for visibility-only gateways; the maintainer label and still-running exact-head checks prevent automated cleanup or merge.

Priority: P2
Reviewed head: 22d16f7a7232d40427888f8d483ea3b9d0873dcc
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A focused repair with a coherent ownership boundary, targeted stale-navigation coverage, and strong real-browser evidence in the supplied PR context.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The PR body supplies an after-fix real Chromium Control UI run against a websocket-backed Gateway and describes the observed alert and reopened-menu error; the supplied check context records successful real-behavior-proof runs.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The PR body supplies an after-fix real Chromium Control UI run against a websocket-backed Gateway and describes the observed alert and reopened-menu error; the supplied check context records successful real-behavior-proof runs.
Evidence reviewed 7 items Session ownership fix: The branch writes a sharing failure into the originating session cache, then publishes the global header error only when the currently selected session key is equivalent to the mutation target; this prevents same-connection navigation from surfacing chat A's error in chat B.
Canonical visible-error owner: The header publisher now updates lastError as well as chatError, matching the chat-state error convention used by adjacent UI paths and ensuring the active header alert receives the failure.
Visibility-only rendering: The sharing status error is moved outside the members-only template branch, so an operator can see a rejected visibility change even when membership management is unavailable.
Findings None None.
Security None None.

How this fits together

Control UI session sharing sends visibility or membership mutations to the connected Gateway for the selected chat. The chat pane owns both the session-local sharing menu state and the global header alert, so asynchronous failures must be retained for the originating session but published globally only for the still-active chat.

flowchart LR
  A[Selected chat session] --> B[Sharing menu]
  B --> C[Gateway sharing mutation]
  C --> D{Mutation result}
  D -->|Failure| E[Session-local sharing error]
  E --> F{Originating chat still active?}
  F -->|Yes| G[Chat header alert]
  F -->|No| H[Error retained only for that session]
Loading

Decision needed

Question Recommendation
Should the session-sharing owner accept this focused UI repair after the current-head merge result and remaining checks are refreshed? Refresh and merge: Rebase or refresh against current main, confirm the remaining exact-head checks and existing bot guidance, then merge the focused repair.

Why: The patch has no supported correctness finding, but the protected maintainer label requires explicit human handling and the supplied check set was not yet complete.

Before merge

  • Resolve merge risk (P1) - The branch is behind current main and several exact-head checks were still in progress in the supplied context; refresh the merge result and confirm the remaining checks before landing.
  • Resolve merge risk (P1) - The latest ClawSweeper comment and linked Action artifact could not be fetched during this review because github.com DNS was unavailable; apply any existing Rank-up moves before merge.
Agent review details

Security

None.

PR surface

Source +6, Tests +123. Total +129 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 3 22 16 +6
Tests 4 124 1 +123
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 146 17 +129

Review metrics

None.

Stored data model

Persistent data-model change detected: persistent cache schema: ui/src/pages/chat/chat-pane-sharing.ts, serialized state: ui/src/e2e/session-ownership.e2e.test.ts, unknown-data-model-change: ui/src/e2e/session-ownership.e2e.test.ts, vector/embedding metadata: ui/src/e2e/session-ownership.e2e.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Rebase or refresh this focused UI repair onto current main, confirm the exact-head checks and any existing ClawSweeper Rank-up moves, then land it unchanged if the session-ownership browser proof remains green.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Rebase or refresh this focused UI repair onto current main, confirm the exact-head checks and any existing ClawSweeper Rank-up moves, then land it unchanged if the session-ownership browser proof remains green.

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

Yes, source-reproducible with high confidence: current behavior retains a rejected sharing mutation only in the session menu, while the PR’s focused browser test drives a closed-dropdown rejection and asserts the missing visible outcome. The supplied context also reports an after-fix real Chromium/Gateway run, though this read-only review did not rerun it.

Is this the best way to solve the issue?

Yes. Routing the error through the existing chat-header owner while retaining the session-local state is the narrowest coherent fix: it solves the silent failure without introducing a second global error path or allowing stale async work to affect another selected session.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: This fixes a real but bounded Control UI error-reporting failure without evidence of data loss, security impact, or a core-runtime outage.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body supplies an after-fix real Chromium Control UI run against a websocket-backed Gateway and describes the observed alert and reopened-menu error; the supplied check context records successful real-behavior-proof runs.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body supplies an after-fix real Chromium Control UI run against a websocket-backed Gateway and describes the observed alert and reopened-menu error; the supplied check context records successful real-behavior-proof runs.

Label justifications:

  • P2: This fixes a real but bounded Control UI error-reporting failure without evidence of data loss, security impact, or a core-runtime outage.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body supplies an after-fix real Chromium Control UI run against a websocket-backed Gateway and describes the observed alert and reopened-menu error; the supplied check context records successful real-behavior-proof runs.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body supplies an after-fix real Chromium Control UI run against a websocket-backed Gateway and describes the observed alert and reopened-menu error; the supplied check context records successful real-behavior-proof runs.

Evidence

What I checked:

  • Session ownership fix: The branch writes a sharing failure into the originating session cache, then publishes the global header error only when the currently selected session key is equivalent to the mutation target; this prevents same-connection navigation from surfacing chat A's error in chat B. (ui/src/pages/chat/chat-pane-sharing.ts:139, 22d16f7a7232)
  • Canonical visible-error owner: The header publisher now updates lastError as well as chatError, matching the chat-state error convention used by adjacent UI paths and ensuring the active header alert receives the failure. (ui/src/pages/chat/chat-pane-header.ts:468, 22d16f7a7232)
  • Visibility-only rendering: The sharing status error is moved outside the members-only template branch, so an operator can see a rejected visibility change even when membership management is unavailable. (ui/src/pages/chat/components/chat-session-sharing.ts:172, 22d16f7a7232)
  • Boundary coverage: The branch adds focused tests for both sharing modes, stale failures after navigation to a different session, and a real browser flow that waits for the dropdown to close before rejecting the Gateway mutation and asserting both header and reopened-menu visibility. (ui/src/e2e/session-ownership.e2e.test.ts:370, 22d16f7a7232)
  • Feature-history provenance: Recent current-main history shows a concentrated session-sharing ownership series, including the current mutation guard, stale-load, stale-callback, and operator-scope repairs; the behavior appears to be actively maintained in this UI boundary. (ui/src/pages/chat/chat-pane-sharing.ts:152, a45feb391519)
  • Real behavior proof: The supplied PR context documents a real Chromium/Vite/websocket-backed Gateway run that observes the closed-menu failure alert and the retained inline error after reopening; the provided check context also records successful Real behavior proof runs. (ui/src/e2e/session-ownership.e2e.test.ts:370, 22d16f7a7232)

Likely related people:

  • Shakker: Authored the recent current-main session-sharing repair series covering mutation guards, stale sharing loads and callbacks, and operator scope checks. (role: recent area contributor; confidence: high; commits: a45feb391519, efaf46c677c0, 87ea745b54fa; files: ui/src/pages/chat/chat-pane-sharing.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.

@steipete

steipete commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

Maintainer exact-head review completed at 22d16f7. Root cause: visibility-only session-sharing failures disappeared when Web Awesome auto-closed the menu, and unconditional global publication could leak a stale chat-A error into active chat B. One canonical session owner now retains the originating error, publishes the existing header alert only while that session remains selected, and renders the inline error after reopening; production delta +6. Hosted Blacksmith owner suites: 73/73. Actual Playwright Chromium + Vite + websocket Gateway: visible role=alert after menu auto-close AND originating inline error after reopen, 1/1 passed. Exact-head CI https://github.com/openclaw/openclaw/actions/runs/30762505759 including all four hosted Chromium shards; Workflow Sanity https://github.com/openclaw/openclaw/actions/runs/30762456009 ; Real behavior proof https://github.com/openclaw/openclaw/actions/runs/30762724949 all green. Sol/high full review clean .96. I read complete latest ClawSweeper review: no substantive rank-up exists and formerly pending checks are green. Its automated persistent-cache/schema/vector note is a false positive: this patch changes only process-local UI Map state and browser tests; no SQLite, persistence, schema, migrations, embeddings, config, auth or protocol surfaces change.

@steipete
steipete merged commit 3eca723 into main Aug 2, 2026
144 of 154 checks passed
@steipete
steipete deleted the codex/qa0802-ui-sharing-errors branch August 2, 2026 19:22
@steipete

steipete commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

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 P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor 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.

1 participant