Repository navigation
fix(ui): prevent encoded-path readiness timeouts - #130666
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 27, 2026, 12:02 AM ET / 04:02 UTC. ClawSweeper reviewWhat this changesThis PR makes Control UI E2E route waits compare browser-serialized paths and includes the configured mount path when tests switch sessions. Merge readinessKeep open: current main still has the raw/unmounted test-helper comparisons, while this focused repair normalizes them at the shared browser-test boundary. No blocking functional or security finding was found; exact-head CI is still in progress and the protected maintainer label prevents automated cleanup. Priority: P3 Review scores
Verification
Live VerificationCommand: Result: FAIL (failed) — step 1 Assertions:
How this fits togetherControl UI E2E helpers drive a real Chromium browser against a deterministic Gateway fixture, then wait for the router and visible chat pane to settle. They support regression tests and do not alter production routing. flowchart LR
A[Browser E2E test] --> B[Shared readiness helper]
B --> C[Runtime mount path]
C --> D[Browser pathname serialization]
D --> E[Router settled state]
E --> F[Visible chat pane]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +14, Tests +57. Total +71 across 3 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the shared helper normalization after exact-head checks pass; it keeps browser-path encoding in one test-support boundary and covers both root and encoded mounts. Do we have a high-confidence way to reproduce the issue? Yes—the committed E2E scenario has a high-confidence encoded-mount path, and current main still contains the exact unmounted/raw comparisons it exercises; this review did not execute it. Is this the best way to solve the issue? Yes—the fix belongs in the shared test helper, where runtime route data meets the browser pathname, rather than changing production routing or adding a workaround in each test. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8dac217ce94e. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Land-ready review for head The reproduced defect belongs to the test harness's browser/router representation boundary: browser history percent-encodes literal punctuation retained in router state. Native Before/after proof is recorded in the PR body: both original desktop/mobile cases failed the unchanged helper at 60 seconds; the mounted session case failed its unchanged pane deadline. The repaired branch passed the same flow, root and encoded session navigation, plugin route transitions, and reconnect/loader coverage. The clean rebase preserved the exact patch ( Post-rebase local commands all passed: node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/control-ui-route-readiness.e2e.test.ts ui/src/e2e/chat-continue-in-terminal.e2e.test.ts ui/src/e2e/plugins-hub-navigation.e2e.test.ts ui/src/e2e/dynamic-route-loader-count.e2e.test.ts
node scripts/run-vitest.mjs ui/src/test-helpers/control-ui-e2e.test.ts
node_modules/.bin/oxfmt --check ui/src/test-helpers/control-ui-e2e.ts ui/src/e2e/chat-continue-in-terminal.e2e.test.ts ui/src/e2e/control-ui-route-readiness.e2e.test.ts
node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json ui/src/test-helpers/control-ui-e2e.ts ui/src/e2e/chat-continue-in-terminal.e2e.test.ts ui/src/e2e/control-ui-route-readiness.e2e.test.ts
node --import tsx scripts/run-stylelint.mts ui/src/test-helpers/control-ui-e2e.ts ui/src/e2e/chat-continue-in-terminal.e2e.test.ts ui/src/e2e/control-ui-route-readiness.e2e.test.ts
node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.core.test.ui-pages-e2e.json --incremental
git diff --checkResults: four browser files/seven tests, two helper unit tests, and focused static checks passed. Fresh independent Codex autoreview was clean. CI run 33037747630 is successful on this exact head, including all four UI E2E shards, UI checks, real-Gateway UI E2E, and openclaw/ci-gate. The separate Labeler API timeout recovered on one retry; no code change or gate bypass was used. The latest ClawSweeper comment is currently a review-started placeholder; no findings or Rank-up moves are published to address or skip. It will be reread immediately before merge. Live rules require the satisfied CI gate and do not require an independent approval. No live provider or operator Gateway was used; the relevant boundary is covered by real Chromium and deterministic Gateway fixtures. No screenshot upload is applicable to this nonvisual, test-support-only repair. |
|
Merged via squash.
|
Related: #129933 (sidebar dashboard badge sizing; its CI repair exposed this separate shared-helper defect).
Additional instructions
This is a same-repository, maintainer-editable branch.
What Problem This Solves
Resolves a problem where Control UI end-to-end tests time out waiting for an already-settled route when the configured mount path contains punctuation that browser history percent-encodes. The original desktop and mobile terminal-continuation fixtures both reproduced the failure even though the router reported
success, matchedchat, and had no pending matches.The sibling session-navigation helper also omitted the configured mount path, so switching sessions under a nested mount could wait on a pane the requested navigation never reached.
Why This Change Was Made
Serialize router and expected pathnames through the native
URL.pathnamesetter before comparing them with the browser pathname. This uses the browser's encoding contract without decoding percent escapes or conflating encoded delimiters with path separators. Session navigation now includes the runtime-owned base path and compares the same serialized pathname.All route/status/resolved-location/pending/search/hash checks and the existing visible/active-pane ownership waits remain intact. This does not alter production routing, add test-only production seams, increase timeouts, or bypass browser actionability.
User Impact
No production or visual UI change. Developers can use the shared readiness helpers with punctuation-rich mount paths and navigate exact session keys without false readiness timeouts.
AI-assisted, maintainer-requested test-support repair. Production LOC: +0/-0. Test support: +19/-5. Tests: +58/-1, including a two-case root/encoded-mount regression that distinguishes slash data, session separators, literal percent escapes, and query/hash characters.
Evidence
Before helper edits, the new regression callers failed against current-main baseline
a872abc9782982b3425e7e2eb42ca120896d842a:%7B,%7D, and%60. Both hadstatus: success, the correct session, andpendingMatches: [].After repair, real isolated Chromium with the existing mocked Gateway passed four E2E files / seven tests:
The existing helper unit tests also passed (two tests). The original desktop and mobile active-pane ownership assertions, header actions, clipboard/continuation dialog, and reconnect assertions remain covered.
check:changedpassed repository guards, formatting, dead-export scans, core-test typechecks, and UI typechecks, then caught a localno-shadownaming error. That variable was renamed; focused formatting, lint, stylelint, E2E typechecking, and the full focused browser command above were rerun successfully:Independent Codex autoreview reported no actionable findings. No live provider or operator Gateway was used; this test-support defect is exercised through the real browser/router with deterministic Gateway fixtures. Screenshot uploads are not applicable because no production or visual surface changes.
Post-rebase verification: the patch rebased without conflicts onto
3255882803c78de5103d2d37f7698add84f34c5d;git range-diffconfirmed an identical patch. On head32cc73363b20bd688774113089be3a427c5b1252, the same four-file browser command passed all seven tests in 40.56s, the helper unit command (node scripts/run-vitest.mjs ui/src/test-helpers/control-ui-e2e.test.ts) passed both tests, and all focused checks listed above exited 0.Exact-head CI run 33037747630 completed successfully: 67 successful jobs and 18 scope-disabled skips. All four UI E2E shards, the real-Gateway UI lane, the UI checks, and the required openclaw/ci-gate passed. The separate Labeler run 33037722037 initially failed on a GitHub API response timeout and passed on one failed-job retry (attempt 2); no code or check changes were needed.
ClawSweeper follow-up: the completed review found no actionable functional or security defect. Its sole rank-up move—wait for exact-head UI E2E and required repository checks—is satisfied by the successful CI run linked above. Its separate browser probe reported that the command was still running after 30 seconds and did not provide a terminal test result; that probe is not counted as passing evidence. The completed seven-test local browser run and all hosted UI E2E shards provide the finished proof. A newer review-started placeholder has no additional findings. No timeout, assertion, or code changes were made, and no re-review was requested.