Skip to content

fix: stale Control UI tabs stop retrying after updates - #123932

Merged
steipete merged 2 commits into
mainfrom
codex/legacy-control-ui-build-rejection
Aug 15, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/legacy-control-ui-build-rejection

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Related: #123882

What Problem This Solves

Fixes an issue where stale Control UI tabs would reconnect forever after a Gateway update, even though the Gateway correctly rejected them before registration or RPC dispatch. The affected tabs showed only a reconnecting state instead of the existing page-refresh recovery action, while their repeated handshakes generated an unbounded warning stream.

Why This Change Was Made

Build identity shipped before the dedicated build-mismatch error code, so neither a missing nor an explicit stale build ID proves that a frozen client understands that newer code. The Gateway now uses the already-shipped terminal PROTOCOL_MISMATCH detail plus literal protocol-mismatch reload guidance for every bundled same-origin build rejection, while preserving the pre-registration admission fence.

User Impact

Stale tabs from both compatibility cohorts stop retrying and show the existing Refresh page recovery path. They remain unable to register a client, publish presence, or dispatch RPCs before refresh.

AI-assisted: yes. I reviewed the source, history, tests, and final patch.

Evidence

  • Post-deploy evidence on 054354e099c4952af5152c974253b99af5cfb676 showed three stale tabs safely rejected before RPC, but each retried at the 15-second client backoff cap.
  • Pre-fix Testbox proof: the raw-WebSocket regression failed for an explicit stale pre-code client because it received CONTROL_UI_BUILD_MISMATCH instead of the shipped terminal sentinel: run 31857183451.
  • Final focused Testbox proof: 82 assertions passed across raw Gateway admission, browser-client reconnect policy, login-gate recovery, and Chromium E2E: run 31858198781.
  • Final changed-surface gate passed formatting, production/test types, lint, dead-code, import-cycle, package-boundary, i18n, and architecture guards: run 31858319997.
  • Final autoreview: clean, no accepted/actionable findings, correctness confidence 0.99.
  • Production LOC: +4/-6 (net -2). Tests: +37/-10.

No visual design changed. The Chromium regression asserts that the protocol-mismatch path stays disconnected, does not reconnect, and visibly offers Refresh page.

@clawsweeper

clawsweeper Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui gateway Gateway runtime labels Aug 15, 2026
@steipete
steipete marked this pull request as ready for review August 15, 2026 02:18
@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Aug 15, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. 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. labels Aug 15, 2026
@clawsweeper

clawsweeper Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 14, 2026, 10:26 PM ET / August 15, 2026, 02:26 UTC.

ClawSweeper review

What this changes

The PR changes stale bundled Control UI build rejections to a terminal protocol-mismatch response so affected tabs stop reconnecting and show a Refresh page action.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open for normal maintainer review: current main still sends the build-specific rejection that stale clients do not understand, while this patch maps that path to the existing terminal protocol-mismatch recovery contract without weakening pre-registration admission.

Priority: P1
Reviewed head: 12f06b3195382fb8cfcdd5c18794f101aaba840c

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A focused, net-negative compatibility correction with source-backed two-cohort and visible-recovery coverage.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (linked_artifact): The PR body links after-fix Testbox and Chromium evidence covering Gateway admission, terminal no-retry behavior, and the visible Refresh page result.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (linked_artifact): The PR body links after-fix Testbox and Chromium evidence covering Gateway admission, terminal no-retry behavior, and the visible Refresh page result.
Evidence reviewed 7 items Current-main behavior remains affected: Current main sends CONTROL_UI_BUILD_MISMATCH with a build ID for a rejected bundled Control UI, which is the behavior this PR replaces.
Branch preserves the admission fence: The branch retains the rejection before client construction and changes only its terminal detail and literal recovery message.
Browser terminal-recovery contract: The browser marks PROTOCOL_MISMATCH terminal, and the login gate recognizes its literal message and renders Refresh page recovery.
Findings None None.
Security None None.

How this fits together

The Gateway validates a Control UI WebSocket before it can register, publish presence, or call RPCs. A rejected handshake is interpreted by the browser client and login gate as either retryable or a terminal recovery state.

flowchart LR
A[Open Control UI tab] --> B[Gateway WebSocket admission]
B --> C{Bundled build matches?}
C -->|No| D[Terminal protocol mismatch]
D --> E[Browser reconnect policy]
E --> F[Refresh page recovery]
C -->|Yes| G[Client registration]
G --> H[Gateway RPCs]
Loading

Before merge

  • Resolve merge risk (P1) - The wire detail changes for existing bundled tabs; rebase and rerun the two-cohort Gateway and Chromium recovery proof on the exact merge head before landing.
  • Complete next step (P2) - No repair job is needed; the remaining work is rebase and normal exact-head merge validation.
Agent review details

Security

None.

PR surface

Source -2, Tests +27. Total +25 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 4 6 -2
Tests 2 37 10 +27
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 41 16 +25

Review metrics

Metric Value Why it matters
Production vs test LOC production -2, tests +27 The behavioral correction is net-negative production code while adding focused admission and visible-recovery coverage.

Root-cause cluster

Relationship: canonical
Canonical: #123932
Summary: This PR is the focused compatibility follow-up to the merged Control UI build-admission work.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Rebase with two-cohort recovery proof (recommended)
    Rebase onto current main and rerun raw WebSocket admission plus Chromium recovery checks for missing and explicit stale build IDs.
  2. Accept the compatibility transition
    Land with the documented manual Refresh page fallback for stale build-aware tabs if maintainers accept that recovery behavior.

Technical review

Best possible solution:

Keep the pre-registration rejection and use the long-standing terminal protocol-mismatch recovery signal for stale bundled documents, with exact-head proof for both missing and explicit stale build IDs.

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

Yes: current main emits the dedicated build-mismatch detail before registration, while the focused raw-WebSocket test supplies missing and explicit stale build IDs; the PR body also links pre-fix and after-fix Testbox evidence.

Is this the best way to solve the issue?

Yes: the patch uses the existing terminal protocol-mismatch behavior that old documents already recognize, rather than adding a new compatibility surface, and retains the Gateway admission fence.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P1: Stale Control UI tabs can remain trapped in reconnecting after a Gateway update instead of receiving a usable recovery path.
  • add merge-risk: 🚨 compatibility: The PR changes the Gateway handshake error detail consumed by already-open bundled Control UI clients across deployments.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body links after-fix Testbox and Chromium evidence covering Gateway admission, terminal no-retry behavior, and the visible Refresh page result.
  • 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 (linked_artifact): The PR body links after-fix Testbox and Chromium evidence covering Gateway admission, terminal no-retry behavior, and the visible Refresh page result.

Label justifications:

  • P1: Stale Control UI tabs can remain trapped in reconnecting after a Gateway update instead of receiving a usable recovery path.
  • merge-risk: 🚨 compatibility: The PR changes the Gateway handshake error detail consumed by already-open bundled Control UI clients across deployments.
  • 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 (linked_artifact): The PR body links after-fix Testbox and Chromium evidence covering Gateway admission, terminal no-retry behavior, and the visible Refresh page result.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body links after-fix Testbox and Chromium evidence covering Gateway admission, terminal no-retry behavior, and the visible Refresh page result.

Evidence

What I checked:

Likely related people:

  • steipete: The merged build-admission commit and this PR both center on the Gateway rejection and Control UI recovery path. (role: introduced the current admission behavior and authored its compatibility follow-up; confidence: high; commits: 7f891f4a7806, fc5aed124f51, 12f06b319538; files: src/gateway/server/ws-connection/connect-session.ts, ui/src/app/gateway-store.ts, ui/src/components/login-gate.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

Copy link
Copy Markdown
Contributor Author

Land-ready at 12f06b3195382fb8cfcdd5c18794f101aaba840c.

  • Exact-head CI: 31858858510 — 150 passed, 44 intentional skips, zero failures.
  • Focused Testbox browser/wire proof: 31858198781 — 82 assertions passed.
  • Final Testbox changed gate: 31858319997 — formatting, production/test types, lint, dead-code, package boundaries, i18n, import cycles, and architecture guards passed.
  • Final autoreview: clean; no accepted/actionable findings; correctness confidence 0.99.
  • Production delta: +4/-6. Tests: +37/-10.

The raw-WebSocket proof covers missing and explicit stale build IDs, delivers a post-rejection health RPC, and proves zero registration, presence, and RPC dispatch. The Chromium path proves the shipped protocol mismatch stays disconnected and visibly offers Refresh page.

ClawSweeper is explicitly waived for this repair. The remaining proof is post-deploy observation that the three formerly retrying stale tabs stop reconnecting.

@steipete
steipete merged commit 6abfedc into main Aug 15, 2026
264 checks passed
@steipete
steipete deleted the codex/legacy-control-ui-build-rejection branch August 15, 2026 02:30
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

@clawsweeper

clawsweeper Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: fix: stale Control UI tabs stop retrying after updates This is item 3/3 in the current shard. Shard 3/48.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 15, 2026
* fix(ui): preserve stale client refresh compatibility

* fix(ui): cover build-aware frozen clients
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 gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. 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