Skip to content

test(control-ui): pin repeated same-method e2e waits with after-cursor - #125439

Merged
steipete merged 1 commit into
mainfrom
steipete/bold-ptolemy-c97605
Aug 17, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/bold-ptolemy-c97605

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Resolves a Control UI e2e flake where a repeated same-method gateway request wait could be satisfied by an earlier request from the same page context on slow runners. The shared mock-gateway helper returned the latest matching request from the whole request ring, so the second wait did not prove that a new request had occurred.

Why This Change Was Made

This adds an opt-in waitForRequest(method, { after: priorCount }) cursor and uses it for the 11 genuinely stale-prone repeated waits found by sweeping all Control UI e2e files. The helper hunks are byte-identical to the same change in #125107, so whichever PR lands second can rebase cleanly. Existing one-shot waits retain their current behavior.

The pinned waits cover the second MCP-server save, three chat.history pages, a desktop.launch retry, three config.patch saves, and three sessions.groups.list refetches. In the model-provider tests, the cursor replaces the former expect.poll(count).toBe(n + 1) workaround with the canonical wait primitive.

User Impact

No production runtime behavior changes. Control UI e2e tests now wait for the request caused by the action under test instead of occasionally accepting stale request history, reducing slow-runner flakes while preserving existing test intent.

Evidence

  • node scripts/check-changed.mjs -- ui/src/test-helpers/control-ui-e2e.ts ui/src/e2e/chat-composer-capability-menu.e2e.test.ts ui/src/e2e/claude-sessions.e2e.test.ts ui/src/e2e/desktop-panel.e2e.test.ts ui/src/e2e/model-providers.e2e.test.ts ui/src/e2e/session-management.group-defaults.e2e.test.ts passed (format, Control UI tsgo typecheck, lint, and i18n verification).
  • Three repetition rounds passed for all five touched e2e files plus ui/src/e2e/login-gate.e2e.test.ts as an untouched control, using node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner <file>: 168 test executions, 0 failures.
  • Codex autoreview (gpt-5.6-sol, high) reported no accepted/actionable findings.
  • Production/test LOC: shared test infrastructure +18/-7; e2e test files +40/-19. No production runtime code touched.
  • Deliberate non-changes from the sweep:
    • cloud-workers-settings cursor pins are owned by feat(control-ui): persistent Ask OpenClaw companion with global toggle #125107.
    • chat-attachment-read-lifecycle asserts that the ring contains zero chat.send requests before its second wait, so that wait cannot match stale history.
    • login-gate second-connect waits follow app-initiated stale-build reloads that reinstall the init-script gateway and restart the request ring; pinning those waits would break the tests.
    • All other textual same-method duplicates across e2e files are cross-test repeats on fresh pages because each it() opens a new page.

waitForRequest(method) is satisfied by ANY prior request of that method
and returns the latest match, so a second same-method wait in one page
context can return a stale earlier request on slow runners. Add the
opt-in { after: priorCount } cursor (same shape as PR #125107's helper
change) and pin the 11 genuinely stale-prone waits: chat-composer-
capability-menu, claude-sessions (3), desktop-panel, model-providers (3,
replacing expect.poll count workarounds), session-management.group-
defaults (3). Skipped: cloud-workers-settings (owned by PR #125107),
chat-attachment-read-lifecycle (ring asserted empty), login-gate (waits
follow app-initiated stale-build reloads, which restart the ring).
@clawsweeper

clawsweeper Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@steipete
steipete marked this pull request as ready for review August 17, 2026 23:00
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: S maintainer Maintainer-authored PR labels Aug 17, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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. labels Aug 17, 2026
@clawsweeper

clawsweeper Bot commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 17, 2026, 7:26 PM ET / 23:26 UTC.

ClawSweeper review

What this changes

The PR adds an optional request-count cursor to the Control UI mock Gateway wait helper and applies it to repeated same-method E2E waits so they require a newly issued request.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

No blocking correctness finding. This protected maintainer PR remains necessary because current main still lets repeated waits resolve against prior requests; wait for the remaining exact-head UI E2E shard before normal merge handling.

Priority: P3
Reviewed head: 60f14600711bd77fde274c6f1bb4f4985503067f

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch is a focused owner-boundary test repair with clear source rationale and reported repeated E2E validation.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored test-only PR is outside the external-contributor real-behavior-proof gate; the PR body reports repeated mocked Control UI E2E validation.
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 outside the external-contributor real-behavior-proof gate; the PR body reports repeated mocked Control UI E2E validation.
Evidence reviewed 5 items Current-main behavior: Current main accepts any prior same-method request and returns the latest match, so it does not provide the requested fresh-request guarantee.
Owner-boundary repair: The proposed helper waits until filtered requests exceed the pre-action count and returns the request at that cursor, preserving the old latest-match behavior when no cursor is supplied.
Request-ring contract: The mock records every request before deferred handling and preserves filtered request order, making the count cursor a direct owner-boundary assertion.
Findings None None.
Security None None.

How this fits together

Control UI E2E tests run the web application against an in-page mock Gateway that records outgoing requests. Test actions wait on that request ring before asserting UI state or request payloads.

flowchart LR
  A[Control UI test action] --> B[Mock Gateway request ring]
  B --> C[Wait helper]
  C --> D{After cursor supplied}
  D -->|Yes| E[First new matching request]
  D -->|No| F[Latest matching request]
  E --> G[E2E assertion]
  F --> G
Loading

Before merge

  • Resolve merge risk (P1) - The supplied check snapshot still had one exact-head UI E2E shard in progress; merge should wait for its terminal result.
  • Complete next step (P2) - This protected maintainer PR needs normal exact-head CI completion and merge handling, not repair-lane dispatch.
Agent review details

Security

None.

PR surface

Source +13, Tests +19. Total +32 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 1 19 6 +13
Tests 5 39 20 +19
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 58 26 +32

Review metrics

Metric Value Why it matters
Production versus test LOC production +0/-0; test support +19/-6; E2E tests +39/-20 All changed lines are Control UI test infrastructure or E2E coverage; no production runtime behavior changes.

Stored data model

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

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep the opt-in cursor as the canonical repeated-request wait primitive and land it once exact-head CI is green.
  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 opt-in cursor as the canonical repeated-request wait primitive and land it once exact-head CI is green.

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

Yes—current main’s helper accepts any earlier matching request, and the modified flows create repeated requests in one page context; the source path is high-confidence although this read-only review did not execute it.

Is this the best way to solve the issue?

Yes—the helper owns the request-ring contract, and the optional cursor fixes repeated waits without changing existing one-shot wait semantics.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 44e8b6f12b0c.

Labels

Label justifications:

  • P3: This is a focused test-flake reduction with no production runtime impact.
  • 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 outside the external-contributor real-behavior-proof gate; the PR body reports repeated mocked Control UI E2E validation.

Evidence

What I checked:

Likely related people:

  • steipete: Current-main blame and helper history identify Peter Steinberger as the dominant recent contributor, and this branch changes the same helper. (role: historical and recent Control UI E2E helper contributor; confidence: high; commits: 98d7b38d4817, 60f14600711b; files: ui/src/test-helpers/control-ui-e2e.ts)

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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-08-17T23:07:10.698Z sha 60f1460 :: needs maintainer review before merge. :: none

@steipete
steipete merged commit 3a431bc into main Aug 17, 2026
425 of 432 checks passed
@steipete
steipete deleted the steipete/bold-ptolemy-c97605 branch August 17, 2026 23:31
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 18, 2026
openclaw#125439)

waitForRequest(method) is satisfied by ANY prior request of that method
and returns the latest match, so a second same-method wait in one page
context can return a stale earlier request on slow runners. Add the
opt-in { after: priorCount } cursor (same shape as PR openclaw#125107's helper
change) and pin the 11 genuinely stale-prone waits: chat-composer-
capability-menu, claude-sessions (3), desktop-panel, model-providers (3,
replacing expect.poll count workarounds), session-management.group-
defaults (3). Skipped: cloud-workers-settings (owned by PR openclaw#125107),
chat-attachment-read-lifecycle (ring asserted empty), login-gate (waits
follow app-initiated stale-build reloads, which restart the ring).
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: 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