Skip to content

fix(ui): catalog dashboard e2e stalls in reconnect on loaded runners - #193197

Merged
steipete merged 1 commit into
mainfrom
fix/catalog-dashboard-reconnect-clock
Nov 7, 2026
Merged

steipete merged 1 commit into
mainfrom
fix/catalog-dashboard-reconnect-clock

Conversation

@steipete

@steipete steipete commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Related: #190824 (CI run 41404623180, job checks-ui-e2e 6/7, failed on an unrelated head)

What Problem This Solves

Fixes: the Control UI model catalog dashboard e2e test (ui/src/e2e/model-catalog-dashboard.e2e.test.ts) intermittently times out in its reconnect step on loaded CI runners, with the UI stuck in reconnecting, failing unrelated PRs.

User Impact

No user-visible change. The test no longer flakes in its reconnect step, so unrelated PRs stop failing checks-ui-e2e on it.

Why This Change Was Made

The compact replay pauses Playwright's virtual clock and drives each action by polling page.clock.runFor(50) inside a 15 s real-time expect.poll budget. The reconnect step calls reconnectMockGateway, whose offline → new socket attempt → online → connected transitions are awaited in real time with page.waitForFunction. That couples two clocks:

  • The step needs about 1 s of virtual time, the transport's first reconnect delay (800–960 ms), so about 20 polls. When polls are slow, the 15 s budget runs out first and the UI is left in reconnecting, which is the CI signature.
  • When polls are fast and the host lags, virtual time passes the browser socket's 30 s opening deadline. The offline attempt closes and backoff grows (observed: a second attempt after a 1.4–1.6 s backoff).

The reconnect step now runs with the clock ticking, the way boot already does, then pauses it again. That matches the other suites, which call page.clock.resume() before reconnectMockGateway. The helper now documents that it expects a ticking clock. Assertions, timeouts, and row attribution are unchanged; the reconnect row still waits for its post-reconnect catalog read.

Evidence

  • Mechanism, instrumented locally: a probe logged virtual time, socket states and connect counts on every poll.
    • Normal run: the new socket appears after ~0.9–1.0 s virtual (~20 polls). The offline socket stays CONNECTING (the mock never fails it), so backoff does not grow in normal timing.
    • Host held 30 s before setOnline(true): the offline socket closed at ~31 s virtual, and the next attempt came after the grown backoff.
    • No local timing reproduced the CI failure unthrottled: 6 parallel copies, 6× page CPU throttle, and 8 s host lag all passed.
  • Throttled variant (900 ms real host delay per virtual-time poll), same harness applied to both:
    • base 0809cf31e693: 2/2 failed at reconnect with expected false to deeply equal true, readiness {gatewayPhase: "reconnecting", rosterReady: false, ready: true} (identical to the CI dump).
    • this branch: 2/2 passed all 24 rows.
  • Bounded loop, 20 runs each of base and this branch, unthrottled, two parallel workers on a host at load average 110–143:
    • base: 19/20. The failure was organic: it stopped at reconnect with the CI signature above, after the 15 s poll budget.
    • this branch: 20/20.
  • Checks: oxfmt --check and git diff --check clean on the changed files. The local oxlint wrapper timed out preparing plugin-sdk boundary types under host load; CI lint covers it.
  • Review: Codex autoreview (local diff vs 0809cf31e693, P0–P1): scoped-clean, no findings.

Gap: the CI failure dump has no transport state, so which of the two modes the CI runner hit is not proven. The fix removes the coupling behind both.

The compact replay paused the virtual clock and drove the reconnect step
by polling runFor(50) inside a 15 s real-time budget, while
reconnectMockGateway awaits its offline -> new attempt -> online ->
connected transitions in real time. Slow polls exhaust the budget before
the ~1 s first reconnect delay elapses; a lagging host lets virtual time
pass the 30 s socket opening deadline so backoff grows.

Run reconnect with the clock ticking like boot (and like the other
suites that resume before reconnectMockGateway), then pause again.
Document that contract on the helper.
@clawsweeper

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

@steipete
steipete marked this pull request as ready for review November 5, 2026 05:12
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 5, 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-05T05:14:33.544519Z c7f52c0 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. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. 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 5, 2026
@clawsweeper

clawsweeper Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR resumes the browser clock during the catalog dashboard test’s reconnect step and documents the helper’s clock requirement.

Example: The compact dashboard replay reconnects while virtual-time polls take 900 ms each.

  • Before: The reported baseline exhausts its polling budget while the Gateway remains reconnecting.
  • After: The reported candidate completes reconnect and all 24 attribution rows.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The narrow repair has credible browser-harness evidence and preserves coverage, but its added test lines currently fail required CI.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored, test-only repair has reported controlled browser comparisons and passing exact-head UI E2E checks; no separate production behavior proof is required.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: Unrelated contributions intermittently fail Control UI E2E because the catalog dashboard replay stalls during reconnect.
Reason: The maintainer-authored change repairs test orchestration while preserving production behavior and the existing catalog coverage.

Regression provenance

Possible regression — probable (reviewed change; failure trace). No predecessor PR is attributed.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep open: this PR makes a focused reconnect timing repair, but its seven unbudgeted test lines cause a required CI failure.

Priority: P2
Reviewed head: c7f52c0be787080117e7d4084f6fa040b426f3a0

Before merge

  • Allocate the seven added test lines so the required ratchet passes (P2) - Both changed files count toward the test-line ratchet, and this patch adds seven net lines without an allocation. The checkout has 6,478,906 counted lines against a 6,478,805 ceiling. Although most of that excess is inherited, the ratchet exempts inherited excess only when the patch adds no test lines, so this positive delta makes the required check fail; its annotations confirm test-lines failed. Add a justified seven-line allocation under config/test-lines-allocations/, preserving the shared scalar and existing assertions.

Findings

  • [P2] Allocate the seven added test lines so the required ratchet passes — ui/src/e2e/model-catalog-dashboard.e2e.test.ts:332-337
Agent review details

How this fits together

The browser E2E replay drives the Control UI against a mock Gateway and records catalog requests after navigation, invalidation, and reconnect events.

flowchart LR
Replay[Dashboard replay] --> Clock[Browser clock]
Clock --> UI[Control UI]
UI --> Transport[Gateway transport]
Transport --> Mock[Mock Gateway]
Mock --> Assertions[Catalog request assertions]
Loading

Technical review

Best possible solution:

Retain the focused clock repair and add a justified seven-line test allocation without raising the shared baseline.

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

Source confirms that reconnect mixes host-awaited transitions with incremental virtual-time advancement; the body supplies controlled before/after reproduction, but no target code was executed during this review.

Is this the best way to solve the issue?

Resuming the existing clock around the existing reconnect helper is the smallest complete repair: transport timers progress naturally, then deterministic catalog settlement resumes without weakening assertions.

Full review comments:

  • [P2] Allocate the seven added test lines so the required ratchet passes — ui/src/e2e/model-catalog-dashboard.e2e.test.ts:332-337
    Both changed files count toward the test-line ratchet, and this patch adds seven net lines without an allocation. The checkout has 6,478,906 counted lines against a 6,478,805 ceiling. Although most of that excess is inherited, the ratchet exempts inherited excess only when the patch adds no test lines, so this positive delta makes the required check fail; its annotations confirm test-lines failed. Add a justified seven-line allocation under config/test-lines-allocations/, preserving the shared scalar and existing assertions.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.96

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 1e101d06645b.

Provenance checked

  • Compact dashboard action scheduling changes intended behavior with a stated reason (99c1b1a: Shorten browser replay using virtual-time settlement while retaining all attribution and reconnect assertions.)
  • Reconnect helper contract keeps the original intent (e47bc5a: Exercise restart/reconnect transitions for the Control UI plugin installation flow; this PR adds documentation without changing the helper.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

Acceptance criteria:

  • pnpm check:test-lines-ratchet --base 0809cf3 --no-merge-base
  • git diff --check
  • Verify that config/test-lines-baseline.txt and the reconnect assertions remain unchanged.

What I checked:

  • Focused introduced change: The introduced diff resumes the clock only for compact-mode reconnect, then restores paused-clock settlement; request-count and reconnect assertions remain intact. (ui/src/e2e/model-catalog-dashboard.e2e.test.ts:331, c7f52c0be787)
  • Current main still uses paused reconnect: Fetched main exempts only boot from virtual-time polling, while reconnectMockGateway waits for socket creation and connection in real time; another existing suite resumes its clock before calling the same helper. (ui/src/e2e/model-catalog-dashboard.e2e.test.ts:331, 1e101d06645b)
  • Diff-caused test-line gate failure: Read-only counting finds 6,478,906 test lines against a ceiling of 6,478,805, an excess of 101. This PR adds seven counted lines without changing allocations. The ratchet permits an inherited excess only for nonpositive test-line deltas. (scripts/check-test-lines-ratchet.mts, c7f52c0be787)
  • Required CI failure corroborates source: The baseline-ratchets check explicitly reports test-lines failed, and ci-gate reports the failed baseline job. The downloadable job log redirects to a blocked host; annotations and independently verified ratchet inputs establish the actionable failure. (c7f52c0be787)
  • Behavioral evidence and passing browser checks: The body reports controlled baseline failures and candidate passes, plus an unthrottled baseline reconnect failure versus 20 candidate passes. Exact-head UI E2E checks returned success, including shard 6/7; these support the test repair without proving which timing mode caused the earlier CI incident. (c7f52c0be787)
  • Original virtual-time intent: improve(ui): shorten catalog dashboard browser replay #190397 introduced compact virtual-time settlement to shorten replay while preserving attribution and reconnect assertions; this repair retains that design outside transport transitions. (ui/src/e2e/model-catalog-dashboard.e2e.test.ts:331, 99c1b1a76a9c)

Likely related people:

  • Peter Steinberger: Raw commit ed22dfb adds ui/src/e2e/model-catalog-dashboard.e2e.test.ts:218 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: ed22dfb04081; files: ui/src/e2e/model-catalog-dashboard.e2e.test.ts)

PR surface

Tests +7. Total +7 across 2 files. Added test files: 0.

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

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: A focused test reliability repair prevents unrelated PR failures; the remaining blocker is a narrow test-budget correction.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

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 5, 2026, 12:26 AM ET / 05:26 UTC.

@steipete
steipete merged commit 06b7e24 into main Nov 7, 2026
170 of 176 checks passed
@steipete
steipete deleted the fix/catalog-dashboard-reconnect-clock branch November 7, 2026 05:11
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 8, 2026
…penclaw#193197)

The compact model catalog dashboard replay now runs its reconnect step with the virtual clock ticking, like boot, so the real-time transport waits in reconnectMockGateway no longer race the reconnect backoff and socket opening deadline on loaded runners.

Admin merge: the only failing check was checks-fast-baseline-ratchets (test-lines), with ci-gate reporting it. That run measured 131 lines over the ceiling, but this PR's net delta was +7; the remaining 124 lines were inherited main debt, since reconciled by openclaw#193765. On current main with this PR merged, the ratchet passes (6558436 lines, ceiling 6558507), and ui/src/e2e/model-catalog-dashboard.e2e.test.ts passes locally (1/1) on that merged tree under host load of about 50 on 32 cores.
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. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XS status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant