Skip to content

fix(ci): stabilize Control UI history and reconnect checks - #120732

Merged
steipete merged 1 commit into
mainfrom
codex/fix-control-ui-e2e-reconnect-races
Aug 9, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/fix-control-ui-e2e-reconnect-races

Conversation

@steipete

@steipete steipete commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Resolves two race-prone Control UI end-to-end checks that failed the main CI run at https://github.com/openclaw/openclaw/actions/runs/31279593984 even though the exercised product behavior was correct. The failures affected external-session history autoload and same-client session-list reconnect coverage.

Why This Change Was Made

The history scenario jumped directly to the top before recording a nonzero transcript position, so the UI did not always observe upward scroll intent. It now establishes and verifies the bottom position before triggering the older-page read, matching the adjacent native-history scenario.

The reconnect scenarios armed global one-shot Gateway deferrals while the old socket could still issue requests, allowing the wrong socket generation to consume the deferral and later drop the resolved response. They now use the existing offline gate: retire the old socket, wait for visible reconnect state and the replacement socket, arm deferrals while no socket can handshake, then resume online and verify the refreshed generation.

This is the test-owner fix: it changes no production behavior, retries, or timeouts. Production LOC: +0/-0. Tests: +35/-6.

Provenance: the external-history autoload scenario was introduced by #105209 on 2026-07-12 (code/PR author and merger @steipete). The reconnect coverage was split into its current file by #114889 and expanded by #117103; #120501 most recently changed the same-client deferral ordering, but the one-shot deferral still was not generation-bound (all code/PR author and merger @steipete).

User Impact

No user-visible behavior changes. Maintainers get deterministic Control UI CI coverage for the existing history and reconnect contracts.

Evidence

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: XS maintainer Maintainer-authored PR labels Aug 8, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Aug 9, 2026
@clawsweeper

clawsweeper Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 8, 2026, 8:39 PM ET / August 9, 2026, 00:39 UTC.

ClawSweeper review

What this changes

The PR makes Control UI browser tests establish scroll intent and isolate replacement gateway sockets before asserting history reload and reconnect behavior.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

No patch defect found. The branch repairs two test-harness ordering races, and current main does not yet contain those changes; the protected maintainer PR should remain open for normal landing review.

Priority: P3
Reviewed head: ab77628b905d989d93330dcc0b28b3d4f6f4c4b1

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, source-aligned test repair with green exact-head CI evidence and no actionable correctness finding.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored, test-only PR is covered by the supplied exact-head Control UI E2E and CI evidence; no contributor live-product proof is required.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored, test-only PR is covered by the supplied exact-head Control UI E2E and CI evidence; no contributor live-product proof is required.
Evidence reviewed 5 items History contract: The history owner only treats an upward scroll as intent after a prior non-null position, a decrease, and a near-top position; the new setup records a verified bottom position before scrolling upward.
Reconnect harness contract: One-shot deferrals are consumed globally, while the offline gate prevents a replacement socket from handshaking; the new ordering retires the old socket before arming deferred responses.
Established sibling pattern: A sibling Control UI reconnect scenario already uses offline → reconnecting → replacement socket → online → ready sequencing, so this follows the existing harness owner boundary.
Findings None None.
Security None None.

How this fits together

Control UI end-to-end tests drive the browser through a mock Gateway to verify session-history pagination and sidebar refreshes across reconnects. They protect client connection-lifecycle behavior without changing production code.

flowchart LR
  Browser[Browser scenario] --> UI[Control UI]
  UI --> Gateway[Mock Gateway]
  Gateway --> State[Connection and scroll state]
  State --> Requests[Session requests]
  Requests --> Assertions[E2E assertions]
Loading

Before merge

  • Resolve merge risk (P1) - The latest ClawSweeper comment was not retrievable because GitHub API DNS failed, so its rank-up moves should be confirmed before landing.
  • Complete next step (P2) - The protected maintainer PR has no mechanical repair remaining; its normal landing review should confirm the unavailable prior ClawSweeper rank-up instructions.
Agent review details

Security

None.

PR surface

Tests +29. Total +29 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 35 6 +29
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 35 6 +29

Review metrics

Metric Value Why it matters
Production versus test LOC production +0/-0; tests +35/-6 The focused test-only growth strengthens deterministic coverage without expanding runtime behavior.

Stored data model

Persistent data-model change detected: serialized state: ui/src/e2e/session-management.sidebar.e2e.test.ts, unknown-data-model-change: ui/src/e2e/session-management.sidebar.e2e.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep the tests tied to observed scroll and connection-generation state, then confirm the latest review instructions during normal maintainer landing.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep the tests tied to observed scroll and connection-generation state, then confirm the latest review instructions during normal maintainer landing.

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

Yes, at source level: the prior history test omits the owner’s scroll-intent precondition, and the prior reconnect test can let an old socket consume a global one-shot deferral.

Is this the best way to solve the issue?

Yes. The patch repairs sequencing at the E2E harness boundary and matches an existing offline-gate sibling pattern instead of adding production retries or timeouts.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 56cdad505594.

Labels

Label changes:

  • add P3: This is a bounded CI-stability repair with no user-visible runtime or configuration change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored, test-only PR is covered by the supplied exact-head Control UI E2E and CI evidence; no contributor live-product proof is required.

Label justifications:

  • P3: This is a bounded CI-stability repair with no user-visible runtime or configuration change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored, test-only PR is covered by the supplied exact-head Control UI E2E and CI evidence; no contributor live-product proof is required.

Evidence

What I checked:

Likely related people:

  • steipete: Authored the current patch and the directly related merged history-autoload, suite-split, reconnect, and prior deferral-order work. (role: recent Control UI test and reconnect contributor; confidence: high; commits: ab77628b905d, 842f8f3ee92c, a5ee5039ce9c; files: ui/src/e2e/claude-sessions.e2e.test.ts, ui/src/e2e/session-management.sidebar.e2e.test.ts)

Rank-up moves

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

  • Before landing, read the latest ClawSweeper comment and confirm any rank-up moves that could not be retrieved in this review.

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
steipete merged commit a5cad30 into main Aug 9, 2026
86 checks passed
@steipete
steipete deleted the codex/fix-control-ui-e2e-reconnect-races branch August 9, 2026 08:18
@steipete

steipete commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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 maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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