Skip to content

fix(ui): prevent login gate test timeout during startup - #169248

Merged
obviyus merged 2 commits into
mainfrom
fix/login-gate-e2e
Oct 11, 2026
Merged

obviyus merged 2 commits into
mainfrom
fix/login-gate-e2e

Conversation

@obviyus

@obviyus obviyus commented Oct 11, 2026

Copy link
Copy Markdown
Collaborator

Related: #168588

What Problem This Solves

Fixes: the generic-help login-gate browser test can time out waiting for the login screen while its own startup barrier is held.

User Impact

No user-visible change. This repairs a Control UI test fixture without changing Gateway authentication, login behavior, timeouts, or assertions.

Why This Change Was Made

The startup regression added in 9a98e2e holds the emitted Chat JavaScript chunk before waiting for the lazy login screen. That barrier can also prevent the login screen from becoming available, so the test never reaches the release.

Hold the existing route-only Chat stylesheet set instead. The test still observes startupPending === true, starts the no-error fixture before startup completes, and retains every collapsed-help and reveal assertion.

No overlap with designated maintainer changes was found in the changed file's history.

Evidence

  • Unchanged fix(models): allow API-key setup while the Gateway runs #168588 head b61c1f05efbb1db980722db07e9feacf922afe0b: the requested direct login-gate command passed twice (25/25 each).
  • Clean main ab6c07f595e963ec86b93c11c90ac8d7ebf470b6: passed twice (25/25 each).
  • Clean main 95dcdf93588b82b7c6f929d01089bfece6f933a1: failed twice (24 passed, the same generic-help .login-gate 30-second timeout each time).
  • Focused old JavaScript-barrier negative control: reproduced the same timeout. Captured state showed startupPending: true, a stopped Gateway with AUTH_TOKEN_MISSING, and the connecting splash instead of the login screen.
  • Focused stylesheet-barrier case: passed.
  • Original-race negative control: temporarily removing the existing startup wait still fails with Missing mounted login gate using the repaired barrier; the wait was restored before final proof.
  • Final direct browser run of login-gate.e2e.test.ts and initial-connect-splash.e2e.test.ts: 38/38 passed.

Commands used the repository entry point:

node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/login-gate.e2e.test.ts
node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/login-gate.e2e.test.ts ui/src/e2e/initial-connect-splash.e2e.test.ts

Proof ran on macOS arm64 with Node 24.21.0 and local Playwright Chromium; it does not claim a Linux rerun of the entire hosted shard.

Merge danger: two-way door; reverting restores only the old test barrier. Blast radius is this single browser-test scenario; no production code or persisted state changes.

@clawsweeper

clawsweeper Bot commented Oct 11, 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.

@obviyus

obviyus commented Oct 11, 2026

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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. labels Oct 11, 2026
@clawsweeper

clawsweeper Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR holds Chat-only stylesheets instead of Chat JavaScript while testing login-gate startup.

Example: The generic-help browser test rejects connection with AUTH_TOKEN_MISSING while startup is pending.

  • Before: Holding the Chat JavaScript chunk can prevent the lazy login gate from appearing, causing a 30-second timeout.
  • After: Holding Chat-only CSS lets the login gate load while preserving the startup-pending and collapsed-help assertions.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Focused and correct by inspection, with reported browser-harness controls and passing CI; evidence remains harness-based.
Proof confidence 🦐 gold shrimp (3/6) This test-only PR changes no shipped behavior; reported Chromium runs and negative controls exercise the repaired fixture, without claiming live Gateway authentication coverage.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: The login-gate browser test can time out because its startup barrier also blocks the login screen it awaits.
Reason: A narrow fixture repair restores useful regression coverage without changing product behavior or adding another test owner.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it repairs a concrete test-fixture deadlock still present on current main, preserves the regression assertions, and introduces no identified defect.

Priority: P3
Reviewed head: 572dd5697aa80f1db5efe29b2f1bac5a6ba6bcf4

Before merge

None.

Findings

None.

Agent review details

How this fits together

The Control UI browser fixture intercepts bundled asset responses, injects a Gateway authentication failure, and checks the production login gate after startup settles.

flowchart TD
 A[Browser test] --> B[Hold Chat-only CSS]
 A --> C[Inject authentication failure]
 C --> D[Lazy login gate loads]
 D --> E[Release stylesheet barrier]
 E --> F[Check collapsed help and reveal]
Loading

Technical review

Best possible solution:

Merge the focused stylesheet-barrier repair while retaining the existing startup wait and help assertions.

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

The source exposes the circular wait between the held JavaScript response and lazy login rendering, supported by the author's repeated baseline failures; this review ran no target code.

Is this the best way to solve the issue?

The existing route-only stylesheet matcher supplies the needed startup barrier without blocking login JavaScript or weakening assertions.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 34292e09ea88.

Provenance checked

  • Startup barrier and no-error login fixture keeps the original intent (9a98e2e: Prevent clearing the Gateway failure before startup completes, and reproduce that ordering through the existing generic-help scenario.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Pinned introduced change: The introduced diff changes only the asset matcher, associated variable names, and explanatory comment; startup-pending, failure-free, collapsed-help, and reveal assertions remain intact. (ui/src/e2e/login-gate.e2e.test.ts:756, 572dd5697aa8)
  • Current main still uses the JavaScript barrier: Current main holds the emitted Chat route module before awaiting renderLoginGate, and releases it only after that function returns. (ui/src/e2e/login-gate.e2e.test.ts:756, 34292e09ea88)
  • Existing barrier owner: The reused helper selects CSS emitted for Chat but absent from New Session preloads; lazy-custom-element recovery already uses the same matcher. (ui/src/e2e/control-ui-built-module.test-support.ts:62, 572dd5697aa8)
  • Original regression intent: The earlier repair waits for startup completion before clearing the failure state and deliberately preserves the generic-help assertions; this PR retains that intent. (ui/src/e2e/login-gate-e2e.test-support.ts:428, 9a98e2e9226b)
  • Reported browser controls: The author reports repeated clean-main failures, a passing stylesheet-barrier case, a negative control that still catches the original missing-gate race, and 38 passing login-gate/startup-splash cases on macOS Chromium; the related discussion separates this fixture failure from fix(models): allow API-key setup while the Gateway runs #168588.
  • Reviewed head and merge state: GitHub reports the reviewed head as mergeable with a clean merge state; its aggregate CI gate passed, and the supplied complete check inventory contains no failures. (572dd5697aa8)

Likely related people:

  • Peter Steinberger: Raw commit 9a98e2e adds ui/src/e2e/login-gate.e2e.test.ts:764 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 9a98e2e9226b; files: ui/src/e2e/login-gate.e2e.test.ts)

PR surface

Tests +1. Total +1 across 1 file. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 7 6 +1
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 7 6 +1

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This repairs browser-test reliability without changing production login behavior.
  • 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.

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-10-11T17:44:01.207Z sha 180a19d :: needs maintainer review before merge. :: none

Reviewed October 11, 2026, 2:06 PM ET / 18:06 UTC (Revision 2).

@obviyus
obviyus merged commit cbe0b27 into main Oct 11, 2026
67 checks passed
@obviyus
obviyus deleted the fix/login-gate-e2e branch October 11, 2026 18:07
@obviyus

obviyus commented Oct 11, 2026

Copy link
Copy Markdown
Collaborator Author

Landed in cbe0b27. The login-gate e2e waits on the existing route stylesheet barrier instead of the JavaScript startup barrier from 9a98e2e, so the generic-help case no longer times out waiting for .login-gate. Assertions and timeouts unchanged. Proof: failed 2/2 on main 95dcdf9; the old-barrier control reproduced the timeout; the repaired barrier still catches a missing mounted gate; login-gate + initial-connect-splash 38/38 green.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 12, 2026
)

Related: openclaw#168588

## What Problem This Solves

Fixes: the generic-help login-gate browser test can time out waiting for the login screen while its own startup barrier is held.

## User Impact

No user-visible change. This repairs a Control UI test fixture without changing Gateway authentication, login behavior, timeouts, or assertions.

## Why This Change Was Made

The startup regression added in f86c2a9 holds the emitted Chat JavaScript chunk before waiting for the lazy login screen. That barrier can also prevent the login screen from becoming available, so the test never reaches the release.

Hold the existing route-only Chat stylesheet set instead. The test still observes `startupPending === true`, starts the no-error fixture before startup completes, and retains every collapsed-help and reveal assertion.

No overlap with designated maintainer changes was found in the changed file's history.

## Evidence

- Unchanged openclaw#168588 head `b61c1f05efbb1db980722db07e9feacf922afe0b`: the requested direct login-gate command passed twice (25/25 each).
- Clean main `3aa85968da2a24df2797f3a0f82610d19e5fa73f`: passed twice (25/25 each).
- Clean main `de225fcde8e78a9ea928a98381e35d6dccf80b2c`: failed twice (24 passed, the same generic-help `.login-gate` 30-second timeout each time).
- Focused old JavaScript-barrier negative control: reproduced the same timeout. Captured state showed `startupPending: true`, a stopped Gateway with `AUTH_TOKEN_MISSING`, and the connecting splash instead of the login screen.
- Focused stylesheet-barrier case: passed.
- Original-race negative control: temporarily removing the existing startup wait still fails with `Missing mounted login gate` using the repaired barrier; the wait was restored before final proof.
- Final direct browser run of `login-gate.e2e.test.ts` and `initial-connect-splash.e2e.test.ts`: **38/38 passed**.

Commands used the repository entry point:

```sh
node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/login-gate.e2e.test.ts
node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/login-gate.e2e.test.ts ui/src/e2e/initial-connect-splash.e2e.test.ts
```

Proof ran on macOS arm64 with Node 24.21.0 and local Playwright Chromium; it does not claim a Linux rerun of the entire hosted shard.

Merge danger: two-way door; reverting restores only the old test barrier. Blast radius is this single browser-test scenario; no production code or persisted state changes.

Co-authored-by: Ayaan Zaidi <[email protected]>
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 P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XS 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