Skip to content

fix(ui): keep reconnects, browser tabs, and localized search consistent - #115221

Merged
steipete merged 2 commits into
mainfrom
codex/control-ui-postmerge-lifecycle-audit
Jul 28, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/control-ui-postmerge-lifecycle-audit

Conversation

@steipete

@steipete steipete commented Jul 28, 2026 •

Copy link
Copy Markdown
Contributor

Closes #115215
Closes #115216
Closes #115217
Closes #115218

What Problem This Solves

Fixes an issue where users reconnecting or switching Gateways could see a stale connection overwrite their current identity or browser snapshot. Fixes an issue where closing an active browser tab would reselect the deleted tab if the follow-up tab refresh failed. Fixes localized Settings searches that missed visually identical composed and decomposed accented text.

Why This Change Was Made

Keep each Gateway event, browser snapshot, and screenshot attached to the client that owns it. Retire a successfully deleted browser tab immediately, retain an existing fallback when reconciliation fails, and normalize Settings search terms at the search boundary without changing global text or generated translations.

The first hosted full-suite run also revealed that the existing agent-tools browser test left its clicked URL fragment in shared history, causing three unrelated moved-Settings-route regressions. This PR fixes the contamination at its source: the browser test now restores the exact previous URL in a finally block before the next test runs.

User Impact

Gateway reconnects no longer display another connection's identity, tabs, or activity. Closing the last or active browser tab cannot resurrect the removed tab. Localized Settings searches consistently match accented text entered by keyboards, input methods, or copy and paste. Full-suite Settings route regressions no longer inherit the agent tool navigation hash.

Evidence

  • Failing-first Blacksmith proof: four owner regressions fail on unchanged main for stale Gateway events, stale browser snapshots, active-tab closure with a fallback, and final-tab closure.
  • First hosted full-suite run: independently identified the agent-tool hash leak and all three affected Settings-route assertions; fixed the source cleanup rather than bypassing or relaxing the assertions.
  • Exact rebased candidate: seven focused owner and contamination-source suites, 171 tests passing, zero failures.
  • Remote pnpm check:changed: UI and core-test typechecking, changed-path lint, formatting, max-lines, dependency and guard checks, and deterministic Control UI i18n verification.
  • Real system-Chromium end-to-end: 22 tests across remote-browser screenshot cancellation, native sidebar/navigation, Settings search and focus, and sidebar customization.
  • Fresh independent branch autoreview after the suite repair and rebase: patch is correct, 0.92 confidence, no accepted or actionable findings.
  • Exact rebased head: 0baa10c.
  • Final delegated Blacksmith proof: https://github.com/openclaw/openclaw/actions/runs/30365615176

Blacksmith delegated success is established by its wrapper exit status and timing JSON; the ephemeral backing Actions session can be marked cancelled during successful Testbox cleanup.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: S maintainer Maintainer-authored PR labels Jul 28, 2026
@steipete
steipete force-pushed the codex/control-ui-postmerge-lifecycle-audit branch from f6db9cd to 0baa10c Compare July 28, 2026 13:59
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. P1 High-priority user-facing bug, regression, or broken workflow. labels Jul 28, 2026
@clawsweeper

clawsweeper Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 28, 2026, 10:27 AM ET / 14:27 UTC.

ClawSweeper review

What this changes

This PR prevents retired Gateway and browser clients from updating the Control UI, removes a successfully deleted browser tab before reconciliation, normalizes accented Settings-search text, and restores shared test history after a navigation test.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep this PR open for maintainer merge review: the supplied diff is a focused repair for four linked current-main regressions, but the branch is behind current main and carries the protected maintainer label. Likely related people: steipete is the low-confidence routing contact because they supplied the linked reproductions and the two repair commits.

Priority: P1
Reviewed head: 0baa10c2032d52201c63ce3a4ec36d420db7de4a
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The PR has strong claimed real-behavior evidence and focused regression coverage; it needs only a final rebase and check refresh before merge review.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The PR supplies after-fix Blacksmith and system-Chromium evidence for the changed Control UI behavior, and the supplied check state includes a successful Real behavior proof result.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The PR supplies after-fix Blacksmith and system-Chromium evidence for the changed Control UI behavior, and the supplied check state includes a successful Real behavior proof result.
Evidence reviewed 6 items Gateway event ownership fence: The proposed callback accepts Gateway events only when the callback's client is still the active client, preventing a replaced socket from changing current identity or history.
Browser snapshot ownership: Snapshot acceptance and capture eligibility become client-bound as well as epoch-bound, which addresses snapshots resolving after the host has switched Gateway clients.
Committed tab deletion handling: After a successful DELETE, the controller removes the target from its local tab state before a follow-up tab refresh, so a refresh failure cannot reselect the deleted tab.
Findings None None.
Security None None.

How this fits together

The Control UI receives Gateway events and remote-browser snapshots, then projects them into the active connection identity, event history, tab strip, and screenshots. Settings search separately filters localized labels before rendering matching configuration sections.

flowchart LR
  A[Gateway sockets] --> B[Event ownership guard]
  B --> C[Control UI identity and activity]
  D[Browser tab operations] --> E[Client-bound snapshot reconciliation]
  E --> F[Tabs and screenshots]
  G[Localized Settings text] --> H[NFC-normalized search]
Loading

Decision needed

Question Recommendation
Should this protected maintainer-labeled bundled Control UI repair be accepted after it is rebased and its required checks refresh on the final merge head? Rebase and merge after refresh: Refresh the branch against current main and accept it if the focused lifecycle and UI checks remain green.

Why: The four linked regressions are concrete, but the protected label requires explicit human handling and the currently reported merge state is behind the base branch.

Before merge

  • Resolve merge risk (P1) - The branch is behind current main; rebase and refresh the required lifecycle/UI checks so the final merge result, rather than the earlier head, is what receives the proof.
  • Complete next step (P2) - A protected maintainer label and a behind-base branch require explicit maintainer approval after the final head is rebased and revalidated; no mechanical repair finding is currently identified.
Agent review details

Security

None.

PR surface

Source +18, Tests +167. Total +185 across 8 files.

View PR surface stats
Area Files Added Removed Net
Source 4 23 5 +18
Tests 4 175 8 +167
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 8 198 13 +185

Review metrics

None.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Rebase onto current main, retain the ownership checks at the Gateway store and browser-controller boundaries, and merge only after the focused UI proof is refreshed on that exact head.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Rebase onto current main, retain the ownership checks at the Gateway store and browser-controller boundaries, and merge only after the focused UI proof is refreshed on that exact head.

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

Yes, at source level: the linked reports provide deterministic client-replacement, failed-tab-refresh, and Unicode-normalization paths, each covered by focused regression tests in this PR. The supplied context reports failing-first confirmation on main, though it was not independently executed during this read-only review.

Is this the best way to solve the issue?

Yes, based on the supplied patch: client ownership is enforced at the Gateway and browser lifecycle boundaries, deletion state is retired at the committed DELETE boundary, and Unicode normalization stays local to Settings search rather than altering global text handling.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P1: A reconnect can show another Gateway's identity or remote-browser state and issue screenshot work against the wrong active connection, breaking a real Control UI workflow.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR supplies after-fix Blacksmith and system-Chromium evidence for the changed Control UI behavior, and the supplied check state includes a successful Real behavior proof result.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR supplies after-fix Blacksmith and system-Chromium evidence for the changed Control UI behavior, and the supplied check state includes a successful Real behavior proof result.

Label justifications:

  • P1: A reconnect can show another Gateway's identity or remote-browser state and issue screenshot work against the wrong active connection, breaking a real Control UI workflow.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR supplies after-fix Blacksmith and system-Chromium evidence for the changed Control UI behavior, and the supplied check state includes a successful Real behavior proof result.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR supplies after-fix Blacksmith and system-Chromium evidence for the changed Control UI behavior, and the supplied check state includes a successful Real behavior proof result.

Evidence

What I checked:

  • Gateway event ownership fence: The proposed callback accepts Gateway events only when the callback's client is still the active client, preventing a replaced socket from changing current identity or history. (ui/src/app/gateway-store.ts:403, 0baa10c2032d)
  • Browser snapshot ownership: Snapshot acceptance and capture eligibility become client-bound as well as epoch-bound, which addresses snapshots resolving after the host has switched Gateway clients. (ui/src/components/browser/browser-panel-operation-ownership.ts:18, 0baa10c2032d)
  • Committed tab deletion handling: After a successful DELETE, the controller removes the target from its local tab state before a follow-up tab refresh, so a refresh failure cannot reselect the deleted tab. (ui/src/components/browser/browser-panel-controller.ts:435, 0baa10c2032d)
  • Localized search coverage: The search boundary normalizes both candidate and query to NFC and adds bidirectional composed/decomposed-accent regression cases. (ui/src/app-navigation.ts:164, 0baa10c2032d)
  • After-fix behavior proof: The PR body reports focused failing-first regressions, a real system-Chromium end-to-end run, and a delegated Blacksmith run; the supplied check state also records a successful Real behavior proof check for this head. (0baa10c2032d)
  • Current-head refresh needed: GitHub reports this PR as mergeable but behind its base, while the review context identifies a newer current-main SHA; required checks and the lifecycle proof should be refreshed on the final merge head. (9feb6ad16187)

Likely related people:

  • steipete: Authored the linked current-main reproductions and both commits in this focused Control UI repair; broader current-main ownership history could not be independently inspected in this review environment. (role: related reporter and recent area contributor; confidence: low; commits: 60f132a91216, 0baa10c2032d; files: ui/src/app/gateway-store.ts, ui/src/components/browser/browser-panel-controller.ts, ui/src/app-navigation.ts)

Rank-up moves

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

  • Rebase onto current main and refresh the required checks and lifecycle proof on the exact final head.

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 merged commit 58a3679 into main Jul 28, 2026
108 of 117 checks passed
@steipete
steipete deleted the codex/control-ui-postmerge-lifecycle-audit branch July 28, 2026 15:24
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Jul 28, 2026
* origin/main:
  test(codex): de-flake attempt turn-watch timing tests (#115258)
  fix: preserve retryable ACPX lease ownership (#115247)
  fix: serialize ACPX lease ownership transitions
  fix: retain ACPX leases across wrapper reconnects
  refactor: parse ACPX lease command identity
  fix: preserve OpenClaw profile env in macOS launch-at-login plist (#99752)
  refactor(config): retire compaction truncateAfterCompaction gate (#115206)
  improve(ui): reduce duplicate chat startup work (#114743)
  fix(ui): keep reconnects, browser tabs, and localized search consistent (#115221)
  perf(pr): cache complete small file lists (#115199)
  perf(sqlite): skip no-op automatic schema repair (#115193)
  docs(browser): correct Docker sandbox setup (#115254)
  fix(ui): avoid duplicate session refreshes during startup (#114764)

# Conflicts:
#	ui/src/pages/agents/panels-tools-skills.browser.test.ts
vincentkoc added a commit that referenced this pull request Jul 28, 2026
* origin/main:
  test(codex): de-flake attempt turn-watch timing tests (#115258)
  fix: preserve retryable ACPX lease ownership (#115247)
  fix: serialize ACPX lease ownership transitions
  fix: retain ACPX leases across wrapper reconnects
  refactor: parse ACPX lease command identity
  fix: preserve OpenClaw profile env in macOS launch-at-login plist (#99752)
  refactor(config): retire compaction truncateAfterCompaction gate (#115206)
  improve(ui): reduce duplicate chat startup work (#114743)
  fix(ui): keep reconnects, browser tabs, and localized search consistent (#115221)
  perf(pr): cache complete small file lists (#115199)
  perf(sqlite): skip no-op automatic schema repair (#115193)
  docs(browser): correct Docker sandbox setup (#115254)
  fix(ui): avoid duplicate session refreshes during startup (#114764)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 29, 2026
…nt (openclaw#115221)

* fix(ui): fence stale gateway and browser lifecycles

* test(ui): restore history after agent tool navigation
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 P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

1 participant