Skip to content

test(ui): join placement dialog work before fixture teardown - #136354

Merged
steipete merged 2 commits into
mainfrom
codex/test-perf-sixth-placement-fixture
Sep 2, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/test-perf-sixth-placement-fixture

Conversation

@steipete

@steipete steipete commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

After a placement test failed while waiting for its catalog, teardown removed the dialog DOM and restored the native-dialog polyfill while the real move remained pending. Web Awesome closed its native dialog on disconnect, but that did not cancel the placement owner. The retained operation could suppress a later restart in the non-isolated UI test worker.

Give the placement and restart tests one modal fixture that tracks their actual action and request promises. Cleanup settles lazy imports and catalog responses, cancels still-owned dialogs through the existing modal-cancel event, joins callers, then removes the DOM and restores the polyfill. Keep cleanup in afterEach so Vitest preserves the original assertion failure alongside a cleanup failure. Remove the duplicated in-body finally blocks and retain the existing successful Cancel-button interactions.

The original failure-path probe reproduced the pending move and suppressed restart, then recovered them by cancelling the retained owner. The candidate probe exercised delayed-catalog move, restart and offline confirmation. In all three flows, real connected-host cancellation preceded caller settlement, and caller settlement preceded DOM/polyfill release. The delayed catalog painted before cancellation. All three original assertion errors were preserved, all six caller/cleanup observations settled, RPC counts stayed move=1/restart=1/offline=0, and no rescue was used. The initial CI wait failure's trigger remains unknown; this repairs the observed teardown cascade.

All 14 original and 14 candidate placement/restart cases passed, along with seven confirmation sibling cases and the three-flow probe. Whole commands took 6.440 / 6.417 seconds; no normal-path speedup is claimed. Existing one-second waits, polling intervals, real imports, Lit/Web Awesome components, request arguments and assertions remain. Proof used the canonical UI/jsdom configuration, Node 24.19.0 and Web Awesome 3.12.0.

All wrappers joined, temporary roots were empty, all 74 source guards were restored and the private probe was removed. Formatting, typed lint and Codex P0 review passed. Production delta is zero; five test/support files add 151 and remove 95 lines. The 63-line fixture supplies the missing lifetime owner without changing product dialogs, requests, protocols or persistence. Exact-head CI remains required before landing.

CI also exposed a separate shared Gateway test-fixture race. rpcReq cleared the runtime config snapshot and yielded before publishing the mutable fixture overrides. A real in-flight config reader could pin the fixture's on-disk main-only config, making an admitted worktree run fail with an unknown-agent error. The RPC helper now publishes the fixture config synchronously after resetting it. This changes only test support.

A controlled probe kept the existing real command preparation and first agent.wait assertion. With the original helper, the snapshot became empty during the RPC yield, the real loader pinned main-only config, and the existing assertion failed with the same unknown-agent error. With the two-line fix and identical probe, both initial and follow-up turns passed; all preparation, lease-release and wait promises joined. The disk config remained unchanged in each run. This proves the race mechanism; the exact competing reader in the original CI run was not captured.

The complete Gateway selection also exposed an overstrict retained-worktree warning assertion under a long temporary path: the production warning intentionally sanitizes and caps paths at 256 characters. The test now derives its expected displayed path with the existing formatter. It retains the warning count, branch and outcome checks and the actual file-preservation and registry assertions.

Final Gateway validation passed all 323 cases across the original 19-file CI selection and the nine-case server-environment sibling. The focused dirty-checkout case also passed with a 274-character worktree path. The preceding complete run's only failure was the old full-path warning assertion; all 323 case identities and existing timeouts are retained. Formatting, typed lint and a fresh Codex P0 review passed for both CI repairs.

@clawsweeper

clawsweeper Bot commented Sep 2, 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: M maintainer Maintainer-authored PR labels Sep 2, 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 Sep 2, 2026
@clawsweeper

clawsweeper Bot commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 2, 2026, 11:19 AM ET / 15:19 UTC.

ClawSweeper review

What this changes

The branch adds a shared placement-dialog fixture that joins outstanding UI work before teardown, repins Gateway test configuration after reset, and aligns one warning assertion with the production log formatter.

Regression provenance

Possible regression — probable (reviewed change; failure trace). No predecessor PR is attributed.

Merge readiness

✅ Ready for maintainer review

The patch is a coherent, test-only repair for asynchronous dialog teardown plus two Gateway test-fixture assertions. No introduced correctness or security defect was found; this maintainer-authored PR should remain open for normal exact-head CI and maintainer handling.

Priority: P3
Reviewed head: 77a18567e2d14728cfffcdf6ae1102ba246ffbf7

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused test-support repair with a credible lifecycle boundary and no supported blocking finding.
Proof confidence 🌊 off-meta tidepool Not applicable: The repository state identifies this as a MEMBER-authored, test-support PR; the external-contributor proof gate does not apply. The supplied body describes targeted after-fix probes, while source inspection confirms the tested production-action boundary.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The repository state identifies this as a MEMBER-authored, test-support PR; the external-contributor proof gate does not apply. The supplied body describes targeted after-fix probes, while source inspection confirms the tested production-action boundary.
Evidence reviewed 5 items Dialog cleanup owner: The introduced fixture tracks action and request promises, cancels retained connected modal owners, waits for action settlement, then clears the DOM and restores the dialog polyfill.
Placement action boundary: Move and restart load the placement dialog before setting progress state and issuing their Gateway requests; the dialog's modal-cancel handler resolves its owner with a null target.
Gateway fixture reset: The RPC helper now synchronously repopulates the pinned runtime configuration immediately after resetting mutable runtime state and before its next await.
Findings None None.
Security None None.

How this fits together

Web chat placement actions lazily load a target-selection dialog, then call the Gateway to move or restart a session. The affected test helpers must keep the dialog, its requests, and the test runtime configuration alive until those asynchronous actions settle.

flowchart LR
  Tests[Placement tests] --> Fixture[Modal test fixture]
  Fixture --> Dialog[Placement dialog]
  Dialog --> Action[Move or restart action]
  Action --> Requests[Mocked Gateway requests]
  Requests --> Cleanup[Joined fixture cleanup]
  Cleanup --> Teardown[DOM and polyfill teardown]
  GatewayTests[Gateway RPC tests] --> Config[Runtime fixture config]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +2, Tests +54. Total +56 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 1 2 0 +2
Tests 4 149 95 +54
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 151 95 +56

Review metrics

Metric Value Why it matters
Production versus test-support LOC production +0/-0; tests and test support +151/-95 The change is confined to test coverage and shared test fixtures, with no production behavior surface added.

Technical review

Best possible solution:

Retain the single shared cleanup owner for these placement tests so pending dialog operations are cancelled and joined before UI fixture teardown.

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

Yes, from source: placement actions await a modal owner before their request, and the new fixture explicitly tracks and settles that owner before teardown. The supplied PR body also reports focused failure-path probes, though this read-only review did not execute them.

Is this the best way to solve the issue?

Yes: a shared fixture at the dialog-test boundary removes duplicated per-test teardown and preserves the production dialog and Gateway action paths unchanged.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 65e5b2e19c9d.

Labels

Label justifications:

  • P3: This is a bounded test reliability repair with no demonstrated user-facing 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: The repository state identifies this as a MEMBER-authored, test-support PR; the external-contributor proof gate does not apply. The supplied body describes targeted after-fix probes, while source inspection confirms the tested production-action boundary.

Evidence

What I checked:

  • Dialog cleanup owner: The introduced fixture tracks action and request promises, cancels retained connected modal owners, waits for action settlement, then clears the DOM and restores the dialog polyfill. (ui/src/test-helpers/modal-dialog.ts:46, 77a18567e2d1)
  • Placement action boundary: Move and restart load the placement dialog before setting progress state and issuing their Gateway requests; the dialog's modal-cancel handler resolves its owner with a null target. (ui/src/pages/chat/chat-pane-placement.runtime.ts:20, 77a18567e2d1)
  • Gateway fixture reset: The RPC helper now synchronously repopulates the pinned runtime configuration immediately after resetting mutable runtime state and before its next await. (src/gateway/test-helpers.server.ts:1281, 77a18567e2d1)
  • Feature history: Recent merged history shows Peter Steinberger maintaining the placement runtime and prior shared UI-test isolation; the current branch commits are subsequent unmerged work. (ui/src/pages/chat/chat-pane-placement.runtime.ts:20, f166d4ee988f)
  • Current-main and release check: The PR head is unmerged and no local release tag contains it; it is therefore neither implemented on main nor shipped. (77a18567e2d1)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Josh Lehman: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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-09-02T14:24:16.071Z sha 1278e6d :: needs maintainer review before merge. :: none

@openclaw-barnacle openclaw-barnacle Bot added the gateway Gateway runtime label Sep 2, 2026
@steipete
steipete merged commit 5a701b4 into main Sep 2, 2026
248 of 252 checks passed
@steipete
steipete deleted the codex/test-perf-sixth-placement-fixture branch September 2, 2026 15:49
@steipete

steipete commented Sep 2, 2026

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 gateway Gateway runtime 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: M 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