Skip to content

fix: stop Control UI retries after access denial - #191297

Merged
steipete merged 1 commit into
mainfrom
steipete/perf-micro-control-ui-connect-retry-loop-access-denied-20260919
Nov 2, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/perf-micro-control-ui-connect-retry-loop-access-denied-20260919

Conversation

@steipete

@steipete steipete commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes repeated Control UI connection attempts when the Gateway denies operator access, including healthy HTTP probes that reset the transport's reconnect backoff.

User Impact

Access denials stop automatic retries and explain how to sign in as a different user or obtain administrator-granted access before choosing Connect. Disallowed browser origins and missing Gateway token/password configuration also pause retries. Temporary failures keep capped exponential backoff with jitter; observed network restoration and stalled socket openings retain fast recovery.

Why This Change Was Made

The Gateway already sends the typed OPERATOR_ACCESS_DENIED detail. The shared retry policy omitted it, while successful periodic HTTP probes repeatedly replaced the client and reset its backoff. Reuse the existing retry deadline to preserve transport-owned pacing and the existing login panel for recovery. No protocol, schema, config, or cache changes.

Runtime production code grows by six lines: four terminal-code entries, one net reachability line, and copy formatting. The separate reusable measurement script measures synthetic browser transport; it does not claim Gateway registration or database timings.

Evidence

  • Exact-parent Chromium e2e regression: both denied and transient handshakes made 61 attempts over 60 virtual seconds. Candidate denial stays at one; transient retries stay bounded and recover automatically. Explicit Connect and ordinary foreground/online events are covered.
  • 42 shared-client tests, 111 affected UI tests, and five focused Chromium e2e scenarios passed. The page-activation regression failed before the fix when its 875ms HTTP probe beat the scheduled 880ms retry; 31 owner tests pass after the fix.
  • Independent Codex autoreview: no actionable P0–P2 findings. All changed-file checks pass except two unrelated unused exports in src/plugins/embedding-providers.ts and src/plugins/install-transaction.ts; both reproduce on exact parent 8051834a3ded5bc2a566c0fecbe98ad66b6f2555. EmbeddingProviderCreateOptions became unused in refactor(embeddings): separate invocation contracts from host creation #190394 (f90d6c00407a); resolvePluginInstallTransaction lost its final external production caller in fix(plugins): avoid repeating failed update rollbacks #191182 (c108c2ce145f). These are main regressions, not failures introduced by this patch. Final performance results are below.
  • Real-time synthetic A/A controls reproduce 14–17 extra denied attempts per 10 seconds. Five candidate timing samples all have zero extra denied attempts and zero health probes; baseline samples have 13–18 extra attempts.

Five interleaved baseline/candidate pairs per workload, fresh browser contexts, 10 real seconds per sample; allocation sampling ran separately. Median (p95):

Workload / metric Before After
Denied: extra connects 16 (18) 0 (0)
Denied: renderer task CPU 235.2ms (286.1) 132.5ms (152.0)
Denied: sampled allocations 12.73MB (13.34) 0.070MB (0.095)
Transient: extra connects 16 (18) 4 (4)
Transient: renderer task CPU 252.7ms (275.1) 186.2ms (200.9)
Transient: sampled allocations 13.11MB (13.31) 2.42MB (2.47)

A/A task CPU was 267.2–294.1ms for denial and 275.9–284.0ms for transient failure. The work-count reduction is deterministic; timings are browser-thread measurements on a shared host. The benchmark command is node --import ./scripts/tsx.mjs scripts/perf/control-ui-connect-retry-measure.ts --base-build <frozen-base> --candidate-build <frozen-candidate> --output-dir <proof>; no Gateway CPU or database timings are claimed. Focused regression file times: shared policy <0.1s, page activation ~0.2s, browser denial/recovery ~10s (21s including invocation setup).

The 142-line regression allocation covers the end-to-end denial/recovery boundary, explicit terminal code policy, and the interaction between real client backoff and HTTP recovery. Focused e2e also verifies the browser import boundary. Rejected admission never reads session databases or workspaces, so large storage fixtures cannot exercise additional work on this path. No live data was used.

Before: denied admission keeps reconnecting and promises automatic recovery

After: denied admission stops and explains explicit recovery

Exact-head CI exception

Run 41485440672, attempt 1, completed with 71 successful checks and one failed root job, checks-ui-e2e (1/4), plus its aggregate. The failure is the unrelated cron narrow-edit footer fixture: it expects height growth at 390px, but the short Save/Cancel buttons fit on one row (63.140625px before and after). The same assertion fails on exact parent 8051834a3ded5bc2a566c0fecbe98ad66b6f2555; cron sources are unchanged through CI's main parent and tested merge. The layout-dependent assumption entered #152135 (0d43ba6f18d1) and has already been repaired on main in #191290 (2811699d21d7). This is fixture-introduction attribution, not a claim about its first historical failure date. No CI rerun was used to chase green. Landing uses the authorized inherited-failure exception at the reviewed head; it does not relabel failed CI green.

Classify explicit operator, origin, and auth configuration denials at the shared reconnect policy. Preserve transport backoff across successful HTTP health probes while retaining outage and stale-opening recovery. Guide users to explicit Connect after access changes.
@clawsweeper

clawsweeper Bot commented Nov 2, 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.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui scripts Repository scripts size: M labels Nov 2, 2026
@steipete
steipete marked this pull request as ready for review November 2, 2026 16:50
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-02T16:52:40.646865Z 089fa07 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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 2, 2026
@clawsweeper

clawsweeper Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR pauses retries after explicit access or configuration denials and preserves transport backoff while HTTP health checks remain successful.

Example: A reachable Gateway rejects a browser handshake with OPERATOR_ACCESS_DENIED.

  • Before: The browser repeatedly reconnects and promises automatic recovery after access is granted.
  • After: Automatic retries stop, and the page directs the user to choose Connect after obtaining access.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused, source-supported repair with useful browser regressions and inspected copy proof; transport behavior is demonstrated synthetically.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR is outside the ordinary contributor proof gate; inspected screenshots prove the recovery copy, while Chromium scenarios and measurements exercise production browser owners against a mocked WebSocket rather than real Gateway transport.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: An access-denied browser repeatedly attempts admission, while healthy HTTP probes can defeat exponential pacing for temporary handshake failures.
Reason: The maintainer-authored direction explicitly accepts manual recovery after access changes and removes unnecessary connection churn without new configuration or architecture.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it addresses retry churn still present on main, explicitly revises an earlier recovery choice, and introduces no concrete defect found in this review.

Priority: P2
Reviewed head: 089fa07e27ecd85676803d96a19a48b8750fa798

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The supplied evidence does not exercise denial, stopped retries, explicit Connect after a grant, and transient recovery through a real Gateway and native WebSocket.
Agent review details

How this fits together

Gateway handshake errors enter the shared reconnect policy; the browser adapter publishes retry state, and page activation uses HTTP reachability to recover interrupted connections.

flowchart TD
  A[Gateway handshake response] --> B[Shared reconnect policy]
  B --> C[Browser transport]
  C --> D[Application connection state]
  D --> E[Login recovery panel]
  F[HTTP reachability probe] --> G[Page activation owner]
  D --> G
  G --> C
Loading

Technical review

Best possible solution:

Keep retry classification in the shared policy and use the existing transport deadline to preserve backoff while retaining observed-outage recovery.

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

Current-main source shows that OPERATOR_ACCESS_DENIED remains retryable and successful health probes can replace a client during backoff; the PR records parent-failing synthetic browser regressions, but this read-only review ran no target code.

Is this the best way to solve the issue?

The implementation is focused: it extends the existing terminal policy, consumes the application store's existing retry deadline, and preserves the established stale-opening and restored-reachability paths.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 058ef8863a28.

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 00096a1 adds ui/src/app/gateway-page-activation.ts:74 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 00096a11f22b; files: ui/src/app/gateway-page-activation.ts)

PR surface

Source +6, Tests +142, Docs +6, Other +163. Total +317 across 10 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 3 10 4 +6
Tests 4 160 18 +142
Docs 1 6 0 +6
Config 0 0 0 0
Generated 0 0 0 0
Other 2 163 0 +163
Total 10 339 22 +317

Review metrics

Metric Value Why it matters
Production versus regression growth Runtime +10/-4 lines; tests +160/-18 lines; measurement tooling +161 lines The runtime fix reuses existing owners; regression growth covers terminal policy, transport pacing, stale-opening recovery, and browser recovery controls.

Labels

Label changes:

  • add P2: Repeated rejected handshakes and reset backoff create bounded connection churn; the denial panel already explains the access problem.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: Repeated rejected handshakes and reset backoff create bounded connection churn; the denial panel already explains the access problem.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

Rank-up moves

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

  • Strengthen confidence with redacted real-Gateway connection traces showing denial stays paused, explicit Connect succeeds after a grant, and temporary failures recover automatically.

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.

Reviewed November 2, 2026, 12:07 PM ET / 17:07 UTC.

@steipete
steipete merged commit 799586f into main Nov 2, 2026
212 of 222 checks passed
@steipete
steipete deleted the steipete/perf-micro-control-ui-connect-retry-loop-access-denied-20260919 branch November 2, 2026 17:20
@steipete

steipete commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 3, 2026
Classify explicit operator, origin, and auth configuration denials at the shared reconnect policy. Preserve transport backoff across successful HTTP health probes while retaining outage and stale-opening recovery. Guide users to explicit Connect after access changes.
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 docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: M 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