Skip to content

fix(ci): stabilize Control UI sidebar reconnect check - #121609

Merged
steipete merged 1 commit into
mainfrom
steipete/loving-pike-22e8ea
Aug 10, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/loving-pike-22e8ea

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Related: #121438
Related: #120732

What Problem This Solves

Resolves a flaky Control UI browser check where the sidebar reconnect scenario could time out waiting for the refreshed session label even though the production sidebar had correctly applied its canonical reconnect response. The failure reproduced on main locally and in the first attempt of CI run https://github.com/openclaw/openclaw/actions/runs/31363964382.

Why This Change Was Made

The mock Gateway's one-shot deferral selected only by RPC method. During reconnect, the replacement connection legitimately sends two different sessions.list requests: a searched, archived route-resolution lookup and the canonical sidebar roster hydration. Whichever request arrived first consumed the method-global deferral, so the test could resolve the route lookup with the refreshed fixture while the sidebar correctly retained the canonical stale fixture.

The test harness now allows a deferred request to match a subset of request parameters. The sidebar scenario targets the canonical roster request through includeLastMessage: true; existing method-only deferrals keep their FIFO behavior. This completes the earlier #120732 stabilization, which isolated the replacement socket generation but could not distinguish request owners inside that generation.

No production behavior, timeout, retry, or assertion strength changed. Production LOC: +0/-0. Tests and test support: +31/-22 (net +9).

User Impact

No user-visible behavior changes. Maintainers get deterministic Control UI reconnect coverage that exercises the real route-resolution and canonical roster requests without allowing one to impersonate the other.

Evidence

  • Unchanged local stress reproduction failed on iteration 4 at the Reconnect refreshed assertion.
  • Temporary diagnostics captured the reconnect ordering:
    1. initial canonical list: limit: 50, includeDerivedTitles: true, includeLastMessage: true;
    2. route-resolution lookup: limit: 20, archived: "all", searched by the session key;
    3. reconnect canonical list: limit: 50, includeDerivedTitles: true, includeLastMessage: true.
  • Repaired sidebar scenario: passed.
  • Adjacent catalog reconnect scenario (resolves a pending catalog target after reconnect without clearing the draft): passed and does not share this mechanism.
  • Paired stress proof: 10 serial iterations, 20/20 target tests passed.
  • Mock Gateway helper suites: 14/14 passed.
  • Targeted oxfmt --check, type-aware oxlint, and git diff --check: passed.
  • Codex autoreview: clean, no accepted/actionable findings.
  • The separate baseRef: "mainmain" failure in the same historical CI shard is an unrelated input-control race in the terminal-start scenario and is intentionally not changed here.
  • AI-assisted; the author reviewed and understands the change.

@clawsweeper

clawsweeper Bot commented Aug 10, 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 10, 2026 13:58
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: S maintainer Maintainer-authored PR labels Aug 10, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Land-ready evidence for head 84b67cf09ff44a11cee8710795bb2793f1d4daeb:

Root cause: the mock Gateway's method-global sessions.list deferral could be consumed by the reconnect route-resolution lookup (limit: 20, archived search) before the canonical sidebar hydration (limit: 50, includeLastMessage: true). The UI then correctly kept the canonical stale fixture; the test had resolved the wrong request. The harness now supports a partial parameter match, and this scenario defers only the canonical roster request. No production behavior changed.

Focused proof:

  • node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/session-management.sidebar.e2e.test.ts -t 'keeps sidebar sessions visible through a same-client Gateway reconnect' --reporter=verbose — passed.
  • node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/new-session-page.catalog-reconnect.e2e.test.ts -t 'resolves a pending catalog target after reconnect without clearing the draft' --reporter=verbose — passed; this adjacent reconnect path does not share the defect.
  • node scripts/run-vitest.mjs ui/src/test-helpers/control-ui-e2e.mock-gateway.test.ts ui/src/test-helpers/control-ui-e2e.test.ts --reporter=verbose — 14/14 passed.
  • Ten serial paired stress iterations — 20/20 target tests passed.
  • Targeted oxfmt --check, type-aware oxlint, and git diff --check — passed.
  • Codex autoreview — clean, no accepted/actionable findings.
  • Exact-head CI — green: https://github.com/openclaw/openclaw/actions/runs/31395656351

Production LOC: +0/-0. Tests and test support: +31/-22 (net +9).

Known proof gap: ClawSweeper has only published its in-progress placeholder so far, with no findings or Rank-up moves available to address. Per the repository policy, the queued publisher is not a merge blocker; the native landing flow should still stop if an actionable review appears before merge.

@steipete
steipete merged commit ebd03db into main Aug 10, 2026
142 checks passed
@steipete
steipete deleted the steipete/loving-pike-22e8ea branch August 10, 2026 14:23
@steipete

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 size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant