Skip to content

fix(ui): prevent encoded-path readiness timeouts - #130666

Merged
steipete merged 1 commit into
mainfrom
steipete/priceless-euclid-c7cc80
Aug 27, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/priceless-euclid-c7cc80

Conversation

@steipete

@steipete steipete commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

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, matched chat, 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.pathname setter 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:

  • Original terminal-continuation module, desktop then mobile: both hit the unchanged 60-second route deadline. The router retained literal braces/backtick; Chromium exposed %7B, %7D, and %60. Both had status: success, the correct session, and pendingMatches: [].
  • New session-navigation regression: the root case passed; the encoded-mount case hit the existing 10-second pane deadline because the helper navigated without the configured base path.

After repair, real isolated Chromium with the existing mocked Gateway passed four E2E files / seven tests:

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

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:changed passed repository guards, formatting, dead-export scans, core-test typechecks, and UI typechecks, then caught a local no-shadow naming error. That variable was renamed; focused formatting, lint, stylelint, E2E typechecking, and the full focused browser command above were rerun successfully:

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 --check

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-diff confirmed an identical patch. On head 32cc73363b20bd688774113089be3a427c5b1252, 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.

@clawsweeper

clawsweeper Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: S maintainer Maintainer-authored PR labels Aug 27, 2026
@steipete
steipete marked this pull request as ready for review August 27, 2026 03:54
@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 27, 2026
@clawsweeper

clawsweeper Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 27, 2026, 12:02 AM ET / 04:02 UTC.

ClawSweeper review

What this changes

This PR makes Control UI E2E route waits compare browser-serialized paths and includes the configured mount path when tests switch sessions.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

Keep 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
Reviewed head: 32cc73363b20bd688774113089be3a427c5b1252

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused helper-boundary repair with credible browser-E2E evidence and no supported correctness finding; exact-head CI remains to complete.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: This maintainer-authored PR is exempt from the contributor proof gate; its body nevertheless records an after-fix isolated Chromium run through the real router with deterministic Gateway fixtures.
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 PR is exempt from the contributor proof gate; its body nevertheless records an after-fix isolated Chromium run through the real router with deterministic Gateway fixtures.
Evidence reviewed 7 items Current main retains both faulty comparisons: Current main waits for an unmounted, unencoded session pathname and directly compares router/expected raw path strings with the browser pathname.
Shared helper repair: The PR obtains the runtime-owned base path, serializes the expected URL pathname, and applies the same serialization to resolved, exact, and prefix readiness checks.
Owner boundary and route contract: Application navigation builds routes with the runtime base path, and the shared session-path contract constructs base-path-prefixed, segment-encoded session routes.
Findings None None.
Security None None.

Live Verification

Command: 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

Result: FAIL (failed) — step 1 run 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: previous terminal command was still running after 30 seconds: "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"

RUN  v4.1.11 /tmp/clawsweeper-live-proof-130666-2L0XAJ/target

[vitest] still running with no output for 30000ms.

Assertions:

  • FAIL expect_output: Control UI route readiness

How this fits together

Control 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]
Loading

Before merge

  • Resolve merge risk (P1) - Exact-head UI and repository checks are still in progress, so the PR is not yet landing-ready.
Agent review details

Security

None.

PR surface

Source +14, Tests +57. Total +71 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 19 5 +14
Tests 2 58 1 +57
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 77 6 +71

Review metrics

Metric Value Why it matters
Production versus test delta production +0/-0; test support +19/-5; tests +58/-1 The patch is test infrastructure and regression coverage only; it adds no production routing behavior.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    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.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best 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.

Labels

Label changes:

  • add P3: This is a contained Control UI test-support reliability repair with no production user-flow change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit 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 PR is exempt from the contributor proof gate; its body nevertheless records an after-fix isolated Chromium run through the real router with deterministic Gateway fixtures.

Label justifications:

  • P3: This is a contained Control UI test-support reliability repair with no production user-flow change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit 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 PR is exempt from the contributor proof gate; its body nevertheless records an after-fix isolated Chromium run through the real router with deterministic Gateway fixtures.

Evidence

What I checked:

  • Current main retains both faulty comparisons: Current main waits for an unmounted, unencoded session pathname and directly compares router/expected raw path strings with the browser pathname. (ui/src/test-helpers/control-ui-e2e.ts:50, 8dac217ce94e)
  • Shared helper repair: The PR obtains the runtime-owned base path, serializes the expected URL pathname, and applies the same serialization to resolved, exact, and prefix readiness checks. (ui/src/test-helpers/control-ui-e2e.ts:49, 32cc73363b20)
  • Owner boundary and route contract: Application navigation builds routes with the runtime base path, and the shared session-path contract constructs base-path-prefixed, segment-encoded session routes. (ui/src/app/bootstrap.ts:476, 32cc73363b20)
  • Regression coverage: The new table-driven browser test covers root and punctuation-rich mount paths plus encoded session-key components; the continuation fixture covers readiness after the intended pane becomes active. (ui/src/e2e/control-ui-route-readiness.e2e.test.ts:13, 32cc73363b20)
  • History and routing ownership: The current helper lines blame to Peter Steinberger at the available shallow-history boundary; deeper introduction provenance is unavailable, so no predecessor PR is attributed. (ui/src/test-helpers/control-ui-e2e.ts:36, 9a86f34e07db)
  • Current-main and release check: The PR head is not an ancestor of main and no local release tag contains it; the supplied latest release predates this unmerged work. (32cc73363b20)

Likely related people:

  • steipete: Current-main blame assigns the affected helper boundary to Peter Steinberger, and the PR continues work on that same shared path. (role: recent Control UI helper contributor; confidence: medium; commits: 9a86f34e07db, 32cc73363b20; files: ui/src/test-helpers/control-ui-e2e.ts, ui/src/e2e/chat-continue-in-terminal.e2e.test.ts)

Rank-up moves

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

  • Let the exact-head UI E2E and required repository checks complete before landing.

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

Copy link
Copy Markdown
Contributor Author

Land-ready review for head 32cc73363b20bd688774113089be3a427c5b1252.

The reproduced defect belongs to the test harness's browser/router representation boundary: browser history percent-encodes literal punctuation retained in router state. Native URL.pathname serialization fixes the comparison without decoding escaped delimiters. The sibling session helper now carries the runtime-owned mount path. Raw pathname comparisons were replaced; status, route, resolved-location, pending-state, exact/prefix targets, search/hash, and pane-ownership prerequisites remain intact. No production router or UI behavior changes. This is the owner-boundary fix, not a longer timeout or a looser readiness predicate.

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 (git range-diff). Production LOC +0/-0; test support +19/-5; tests +58/-1.

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 --check

Results: 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.

@steipete
steipete merged commit 6b842df into main Aug 27, 2026
184 of 185 checks passed
@steipete
steipete deleted the steipete/priceless-euclid-c7cc80 branch August 27, 2026 04:24
@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 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