Repository navigation
test(ui): wait for the lazy native menu before asserting its trigger - #141533
Conversation
#141466 moved the toStreamingMarkdownParts and indented-source suites into markdown-streaming.test.ts; #141485 then landed the same 16 cases again as markdown-streaming-parts.test.ts during the concurrent max-lines split. The two files differ only in whether htmlFragment is imported or inlined. Keep the copy that shares the test-support helper and drop the other.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 7, 2026, 4:36 PM ET / 20:36 UTC. ClawSweeper reviewWhat this changesRemoves duplicate streaming Markdown tests and makes the native-link menu test wait for its asynchronously created element before checking the latest right-click target. Merge readiness✅ Ready for maintainer review Keep open: the duplicate-suite deletion already landed through #141519, but the new lazy-menu synchronization fix remains useful and is absent from fetched main. No actionable patch defects found; the maintainer-protected PR also remains outside automatic cleanup. Priority: P3 Review scores
Verification
How this fits togetherControl UI tests protect streamed Markdown rendering and native-app link menus. These changes retain rendering coverage and synchronize a menu assertion with the DOM update after a lazy import. flowchart LR
A[Markdown fixtures] --> B[Streaming renderer]
B --> C[Retained rendering assertions]
D[Simulated right clicks] --> E[Lazy native menu import]
E --> F[Menu element appears]
F --> G[Latest target and single append assertions]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests -279. Total -279 across 2 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep one canonical streaming Markdown suite and synchronize the lazy-menu test with element creation while preserving its latest-request and single-append assertions. Do we have a high-confidence way to reproduce the issue? The duplicate coverage is directly verifiable from source. The menu timing failure is supported by the asynchronous owner and reported repeated runs, but was not independently reproduced in this read-only review. Is this the best way to solve the issue? Yes. Equivalent rendering assertions remain intact, and waiting for the menu element observes the actual completion boundary without relaxing the subsequent behavioral assertions. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 0ad318398e90. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
showMenu appends the native link menu in the continuation after its awaited dynamic import, and that microtask can run after vi.dynamicImportSettled() resolves. The assertion read the element synchronously and failed about one run in five on the UI shard. Wait for the element; every assertion is unchanged.
|
Merged via squash.
|
…dget (#138666) Fixes #138590. Measure composer, sessions, session-detail, and usage context displays against a validated last-run prompt budget. Gateway checks session, model/provider, and effective-cap provenance; context-window changes invalidate derived telemetry and session events clear obsolete budgets. Preserve current-cap fallback and approximate-token warning behavior. Retain the original contributor's implementation history and complete the stale-budget repair at its Gateway owners. Label the estimate as a last-run prompt budget rather than promising a specific compaction threshold. Validation: 584 focused tests and real Chromium/mock-Gateway before/after and live-update proof. Final required CI passed on 47f32b9 after one unchanged-job rerun for a documented unrelated temporary-directory teardown race. Main QA repairs #141533 and #141555 are included. Co-authored-by: Peik S. <[email protected]> Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: DasX <[email protected]>
) * test(ui): remove the duplicate streaming markdown suite openclaw#141466 moved the toStreamingMarkdownParts and indented-source suites into markdown-streaming.test.ts; openclaw#141485 then landed the same 16 cases again as markdown-streaming-parts.test.ts during the concurrent max-lines split. The two files differ only in whether htmlFragment is imported or inlined. Keep the copy that shares the test-support helper and drop the other. * test(ui): wait for the lazy native menu before asserting its trigger showMenu appends the native link menu in the continuation after its awaited dynamic import, and that microtask can run after vi.dynamicImportSettled() resolves. The assertion read the element synchronously and failed about one run in five on the UI shard. Wait for the element; every assertion is unchanged.
…dget (openclaw#138666) Fixes openclaw#138590. Measure composer, sessions, session-detail, and usage context displays against a validated last-run prompt budget. Gateway checks session, model/provider, and effective-cap provenance; context-window changes invalidate derived telemetry and session events clear obsolete budgets. Preserve current-cap fallback and approximate-token warning behavior. Retain the original contributor's implementation history and complete the stale-budget repair at its Gateway owners. Label the estimate as a last-run prompt budget rather than promising a specific compaction threshold. Validation: 584 focused tests and real Chromium/mock-Gateway before/after and live-update proof. Final required CI passed on 47f32b9 after one unchanged-job rerun for a documented unrelated temporary-directory teardown race. Main QA repairs openclaw#141533 and openclaw#141555 are included. Co-authored-by: Peik S. <[email protected]> Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: DasX <[email protected]>
What Problem This Solves
ui/src/app/native-link-routing.lazy.test.ts(from #140988 earlier today) failed the UI shard and reproduces locally about one run in five: it reads the lazily appendedopenclaw-native-link-menusynchronously aftervi.dynamicImportSettled(), butshowMenuappends in the continuation after its awaited import, which can run one microtask later.Why This Change Was Made
Wait for the element before asserting its trigger. The product's generation-token logic (
request !== menuRequest) is correct — the later right-click wins; only the test's synchronous read was wrong. No assertion changed. Ten consecutive local runs pass.User Impact
None. Test-only; production LOC 0.
Evidence
ui/src/app/native-link-routing.lazy.test.ts: 10 consecutive local runs pass after the change (about 1 in 5 failed before).Note on scope
This PR was opened to delete the twice-landed
markdown-streaming-parts.test.ts(#141466 vs #141485), but #141519 removed it first; after rebasing, this PR's merged content is the flake fix above only. The squash title predates that and is wider than the change.Related: #140988 #141519 #141494