Skip to content

fix: proxy sign-in restarts while entering browser credentials - #198284

Open
roboclaw-bot wants to merge 2 commits into
mainfrom
openclaw/fresh-langoustine
Open

roboclaw-bot wants to merge 2 commits into
mainfrom
openclaw/fresh-langoustine

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #198226

What Problem This Solves

Fixes: the Control UI repeatedly restarts a pending reverse-proxy sign-in when HTTP health is reachable but the browser is still authenticating its WebSocket.

User Impact

User impact: browser authentication gets the existing 30-second opening budget instead of being interrupted by the approximately eight-second reachability recovery loop. This does not fix Safari Private Browsing asking for credentials on each new WebSocket, so the underlying issue remains open.

A socket-only blackhole with continuously healthy HTTP now waits for the existing transport deadline. Recovery after an observed HTTP outage, closed transports and foreground restoration retain their existing paths. No authentication, permissions or timeout settings are relaxed.

Why This Change Was Made

A successful HTTP health check cannot distinguish a lost upgrade from a native browser authentication dialog. Reuse the client's existing wake-reconnect eligibility before replacing an opening based only on healthy HTTP; an observed outage followed by recovery can still trigger an early retry. This removes an over-eager recovery decision without introducing new state, browser detection or another authentication mechanism.

Evidence

  • Real-transport after-fix proof on published head a513e8f6f532a2cd3aadf0043acfe967ec2d4039: two actual built-UI Chromium navigations through a Basic-auth reverse proxy to the real isolated Gateway. Original upgrades survived 12,004 ms / 12,002 ms, with 5 / 4 successful application HTTP health probes after eight seconds, then completed hello-ok and reached UI connected with one socket per navigation. The service worker remained active. Environment, redacted timestamped trace and cleanup. The delay was induced at the proxy, not a native Safari password dialog.
  • A regression using the real browser client and page-activation owner fails on the base: a 29-second pending opening is replaced three times. With the fix it remains open and can finish opening.
  • Focused owner coverage: 75 tests passed across page activation, browser sockets, reachability and connection handshakes. Coverage includes the unchanged 30-second opening deadline, genuine outage restoration and protection of the replacement socket.
  • Production UI build, targeted typecheck, type-aware lint and formatting checks passed with checkout-local dependencies.
  • 2 built-UI Chromium E2E tests passed: foreground recovery of a suspended socket, and composer/session-menu continuity across reconnect. These use the canonical Gateway fixture, not native Safari auth dialogs.
  • Independent local autoreview of the complete two-file local change against base 439a9c3552da1e939803fc3c69d87bc6e16a6553 (unchanged in commit 4997a68e7107575fef6d2803968142d526da705c): no actionable P0–P2 findings. Local ClawSweeper is unavailable; the hosted review found no actionable code findings and requested the real-transport proof now linked above.
  • The underlying prompt reproduced on the reporter's real iPhone in Safari Private Browsing, including on a minimal page with no OpenClaw, service worker or automatic retry. Regular-tab non-reproduction is the reporter's observation, not a controlled private/regular comparison. The patch has not been retested on that iPhone.
  • No rendered UI appearance changes; the changed boundary is connection cancellation/recovery.

November 14 readiness recheck

Head a513e8f6f532a2cd3aadf0043acfe967ec2d4039 remains conflict-free. The failed check-lint-core-4 job in run 43434586121 reports one error: ui/src/e2e/session-context-breakdown.e2e.test.ts:19 shadows the imported node:path. This PR changes only page-activation source and its regression test, not that file. Main independently fixes the exact error in 6eb8095ae971f51bfa547644d4d249c21ebb8335 (#198281). The CI gate is still red; this is attributed unrelated baseline lint, not a passing check. No rerun or branch push was made just to obtain green.

Reported and reproduced with @jacobtomlinson; co-authored-by credit is retained in the commit.

Work sessions

Linked for team reference; these sessions aren’t public.

Worked on by

roboclaw-bot and others added 2 commits November 13, 2026 13:31
Healthy HTTP does not establish that an opening WebSocket is lost: the browser may still be waiting for reverse-proxy authentication. Preserve its transport deadline unless an observed HTTP outage has recovered. Keep closed-transport and foreground recovery unchanged.

Related: #198226

Co-authored-by: jacobtomlinson <[email protected]>
Worked on by:
- @jacobtomlinson

Co-authored-by: jacobtomlinson <[email protected]>
OpenClaw-Publication: 2eba3a34-f0be-8e20-a2ed-98740cb2c939
@clawsweeper

clawsweeper Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@roboclaw-bot
roboclaw-bot marked this pull request as ready for review November 13, 2026 13:32
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 13, 2026
@clawsweeper

clawsweeper Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR lets a pending WebSocket retain its existing opening deadline when HTTP health remains reachable.

Example: A reverse proxy delays a WebSocket upgrade for 12 seconds while HTTP health checks succeed.

  • Before: The Control UI replaces the pending connection after approximately eight seconds.
  • After: The original connection survives and completes the Gateway handshake after 12 seconds.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Strong production-path proof supports the focused repair; the broader linked issue remains partly unresolved, and required CI is still red.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (logs): The public exact-head trace exercises the actual built UI, native Chromium WebSocket, Basic-auth proxy, and isolated Gateway through delayed upgrades with successful concurrent application health probes, then records successful handshakes without replacement; it resolves the previous proof gap without claiming a Safari credential-cache fix.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Partial
User problem: A browser authentication attempt can be interrupted repeatedly because successful HTTP probes replace its pending WebSocket too early.
Reason: The maintainer-authored direction resolves a concrete OpenClaw interruption with an explicit recovery tradeoff and correctly uses Related for the broader Safari issue.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR narrowly fixes premature connection replacement, with no actionable code findings; the required CI gate remains red.

Priority: P2
Reviewed head: a513e8f6f532a2cd3aadf0043acfe967ec2d4039

Before merge

None.

Findings

None.

Agent review details

How this fits together

The Control UI page-activation owner combines browser lifecycle events, HTTP reachability, and browser-client eligibility to request reconnection through the application Gateway owner.

flowchart TD
  A[Browser lifecycle events] --> C[Page activation owner]
  B[HTTP health probes] --> C
  D[Browser client eligibility] --> C
  C --> E[Application Gateway owner]
  E --> F[Browser WebSocket]
  F --> G[Reverse proxy and Gateway]
Loading

Technical review

Best possible solution:

Keep reconnection policy in the existing owner and preserve pending openings until their transport deadline unless observed HTTP reachability recovers.

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

Current-main source exposes the eight-second replacement path, and the supplied regression reports failure on the base; this read-only review ran no target code.

Is this the best way to solve the issue?

The change is the smallest complete repair for premature replacement: it reuses existing client eligibility, adds no state, and retains outage recovery and transport timeout ownership.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 6055ba3cff85.

Provenance checked

  • HTTP-based replacement of pending WebSocket openings changes intended behavior with a stated reason (00096a1: Recover promptly from silent network outages without waiting for the full opening timeout.)
  • Transport-owned reconnect backoff keeps the original intent (799586f: Prevent successful HTTP probes from repeatedly resetting connection retry backoff while retaining observed-outage recovery.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • RoboClaw: Raw commit 258c737 adds ui/src/app/gateway-page-activation.ts:9 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 258c73769f01; files: ui/src/app/gateway-page-activation.ts)

PR surface

Source +2, Tests +22. Total +24 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 4 2 +2
Tests 1 44 22 +22
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 48 24 +24

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: Premature retries interrupt browser authentication in a specific reverse-proxy deployment, with a focused repair and limited blast radius.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; 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.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-11-13T13:48:56.717Z sha a513e8f :: needs maintainer review before merge. :: none

Reviewed November 13, 2026, 9:52 AM ET / 14:52 UTC (Revision 2).

@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

After-fix proof: real browser, real WebSocket and real Gateway

This addresses the review’s missing real-transport trace on the unchanged reviewed head a513e8f6f532a2cd3aadf0043acfe967ec2d4039.

Environment and controlled delay

  • Built the actual Gateway runtime and production Control UI from that clean checkout. Both used runtime build ID 2026.11.3-a513e8f6f532-2026-11-13T14-17-23.469Z; the normal build-identity checks were retained.
  • Chromium 156.0.8078.4, native browser WebSocket, actual built UI, actual isolated Gateway in trusted-proxy mode. No mocked Gateway, replacement WebSocket class, fake timers or altered application retry/timeout settings.
  • A loopback reverse proxy required HTTP Basic auth for HTTP requests and upgrades. After validating the synthetic credentials, it held each real upgrade request for 12 seconds before forwarding it to the Gateway. Ordinary HTTP requests, including the application’s reachability probes, remained live.
  • The service worker was enabled and controlled the page in both successful cases. Fresh isolated state, read-only operator identity, no model calls or production credentials, no public tunnel.

Result

Actual UI navigation Original upgrade → HTTP 101 Successful application health probes while opening after 8s Browser WebSockets created Completed real handshake / UI
Initial root load 12,004 ms 5, all HTTP 200 1 hello-ok, gatewayPhase=connected
Second navigation to root 12,002 ms 4, all HTTP 200 1 hello-ok, gatewayPhase=connected

In both cases the same original TCP/WebSocket request survived the healthy-HTTP probes beyond eight seconds, then completed before the existing 30-second deadline. No replacement connection was created during either wait. The first connection closed only when the second page navigation began; the second closed during teardown.

Redacted trace

Times below are 2026-11-13 UTC. Credential values and complete protocol payloads were never logged. The health entries are requests made by the real application, identified by its X-OpenClaw-Reachability-Probe: 1 header, not readiness checks sent by the harness.

14:20:08.793  connection=1  authenticated upgrade received; hold begins
14:20:17.334  /healthz 200  application reachability probe; original upgrade pending
14:20:18.210  /healthz 200  application reachability probe; original upgrade pending
14:20:19.126  /healthz 200  application reachability probe; original upgrade pending
14:20:19.976  /healthz 200  application reachability probe; original upgrade pending
14:20:20.749  /healthz 200  application reachability probe; original upgrade pending
14:20:20.794  connection=1  hold released; clientDestroyed=false
14:20:20.798  connection=1  HTTP 101; original request age=12004ms
14:20:20.801  connection=1  real Gateway connect.challenge received
14:20:20.814  connection=1  browser connect request sent
14:20:20.856  connection=1  real Gateway hello-ok received, ok=true
14:20:20.894  actual UI gatewayPhase=connected; service worker controlling=true

14:20:21.166  connection=2  authenticated upgrade received; hold begins
14:20:29.726  /healthz 200  application reachability probe; original upgrade pending
14:20:30.714  /healthz 200  application reachability probe; original upgrade pending
14:20:31.614  /healthz 200  application reachability probe; original upgrade pending
14:20:32.563  /healthz 200  application reachability probe; original upgrade pending
14:20:33.166  connection=2  hold released; clientDestroyed=false
14:20:33.168  connection=2  HTTP 101; original request age=12002ms
14:20:33.170  connection=2  real Gateway connect.challenge received
14:20:33.182  connection=2  browser connect request sent
14:20:33.238  connection=2  real Gateway hello-ok received, ok=true
14:20:33.263  actual UI gatewayPhase=connected; service worker controlling=true
14:20:34.055  cleanup verified: Gateway exited, both listeners closed, browser closed

The retained result JSON has SHA-256 8e1cdf39f9708586f3fcd685dea84c830153f95cd3a50fe48bdccbd4531c7582; the redacted complete event log has SHA-256 669d39ebbf2d09620252f2a25f83c292f35b1798a83fef75b57a1141fced86fd. These identify the local receipts; hashes alone are not independent execution attestation.

Scope: this is real-transport proof of the OpenClaw interruption fix, using an induced upgrade delay rather than a human password dialog. It does not claim a patched iPhone/Safari retest or a repair to Safari Private Browsing credential reuse. The underlying issue remains open. No product source changes or new commits were needed for this proof.

@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 13, 2026

This branch has not been deployed

No deployments
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 P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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