镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

main fix: settle Select popups before choosing agent editor options - #544

Merged
loganj merged 1 commit into
mainfrom
loganj/emergency-agent-control-host-choice
Oct 2, 2026
Merged

loganj merged 1 commit into
mainfrom
loganj/emergency-agent-control-host-choice

Conversation

@loganj

@loganj loganj commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Emergency fix for intermittent Chromium failure on main: run 37025966190 (f264c623), agent-control.spec.mjs:757 "editor renders host choices…", line 807: saved {command: "host-command", provider: "fixture-provider"}, expected provider: "host-provider".

Cause (test race, not product race)

From the CI trace:

  • Both option clicks ran during the Select popup's entry transition (opacity/transform/blur). Playwright logged element is not stable three times for each, so its fourth attempt used scrollIntoView({block: "start"}).
  • That scrolled the scroll-locked document (html.scrollTop 158 → 284). The editor dialog and its trigger are position: fixed, but the Base UI Select popup is document-positioned, so Floating UI re-anchored the popup under the fixed trigger before the press.
  • The press landed on the Provider label (y=166), not "Host provider". Base UI only commits an option whose own pointerdown it saw, so the popup dismissed with "Custom provider / current value" still selected, and save persisted fixture-provider. The final snapshot shows exactly that.
  • No network or async provider loading happened in that window. The host choices were already applied. The command saved correctly only because the harness click happened to land before any re-anchor.

Users can't scroll the locked page underneath a modal, so they don't hit this. The test clicked before the UI settled.

Fix

tests/browser/agent-control.spec.mjs only: a chooseOption helper waits until the open popup has left data-starting-style and has no running animations (the existing opened() pattern in channel-members-focus.spec.mjs), then clicks. It's applied to the editor-dialog option clicks in this test and in the sibling "native-supplied harness choices" test, which uses the same pattern. The failing test also asserts the harness and provider combobox text before saving. No assertions were weakened, and there are no timeouts, retries, sleeps, or skipped engines.

Evidence

  • Forced reproduction (pre-fix): replaying Playwright's retry-4 step on the open provider popup (scrollIntoView({block:"start"}), then press at the post-scroll point) fails 5/5 in Chromium with the identical provider: "fixture-provider". The press lands on SPAN:Provider at scrollTop 284, matching CI.
  • Retry path, before/after: with a lengthened popup transition, the pre-fix "Host harness" click took 3 not-stable retries (so it hit the scrolling attempt). With the fix, both option clicks take 0 retries, so Playwright never scrolls the page.
  • Fixed spec, local macOS: target + sibling tests --repeat-each 20 on Chromium + WebKit: 80/80 passed. Full agent-control.spec.mjs on Chromium + WebKit: 32/32 passed.
  • scripts/check-staged.mjs (Biome) passed. scripts/check-push.mjs (plain, --design, --clippy) passed, with no unit/design/Rust inputs changed. pnpm typecheck passed.

Browser cases added/removed: none. No product code changed, so there is no unit regression test. The defect is in test synchronization.

Logan sent this to team review on 2026-10-02, so it is no longer held as a draft. Review is still required, per AGENTS.md.

Main run 37025966190 (f264c62) failed in Chromium because the
"Host provider" click never selected anything. The option clicks ran
during the Select popup's entry transition. Playwright exhausted three
"element is not stable" retries and its fourth attempt called
scrollIntoView({block: "start"}), scrolling the scroll-locked document
from 158 to 284. The editor dialog and trigger are fixed but the popup
is document-positioned, so Floating UI re-anchored it before the press,
which landed on the Provider label. The popup closed with the custom
value still selected and save persisted fixture-provider.

Wait for the open popup's entry transition to finish before clicking
editor options, and assert the shown harness/provider before saving.
Users cannot scroll the locked page, so this is a test race rather than
a product race.

Signed-off-by: Logan Johnson <loganj@squareup.com>
@loganj loganj changed the title Emergency main fix: settle Select popups before choosing agent editor options main fix: settle Select popups before choosing agent editor options Oct 2, 2026
@loganj
loganj marked this pull request as ready for review October 2, 2026 16:52
@loganj
loganj requested review from a team, comp615 and wesbillman as code owners October 2, 2026 16:52

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No changes requested. The test-only helper waits for the shared Select popup’s entry transition before normal option clicks, preserving saved-value assertions and adding visible harness/provider checks without sleeps, retries, or production changes.

Star Lord automated source review via Wes’s account — head 5e9627ca7f5b0f04a1a243a63d593160d4894dcb, base c9946be433f1957713a19cffca614947c17514ee.

Source-only: I ran no tests or app workflows; hosted CI artifacts show the full affected file passed 32/32 across Chromium/WebKit on the PR merge snapshot, but I did not independently reproduce the race, verify live focus behavior, or establish before/after timing.

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No material findings. The helper waits for the Select popup’s actual entry transition to finish, then performs the normal option click. It neither forces selection nor disables animation; existing saved-value assertions remain, with additional visible harness/provider checks before saving.

Validation: reviewed the complete diff, shared Select/CSS transition, editor selection wiring, and original CI failure. Hosted CI 37031859984 passed for this head on merge snapshot c162bd115eca279708de93634806f3f073ce3e24 (the reviewed base/head). Logs confirm the full affected file passed 32/32 across Chromium and WebKit. No local test run or independent reproduction of the author’s retry/scroll experiment; this is not a blanket claim that selection cannot race in other conditions.

Reviewed head 5e9627ca7f5b0f04a1a243a63d593160d4894dcb against base c9946be433f1957713a19cffca614947c17514ee.

Carl, an automated reviewer, commenting via Wes’s GitHub account.

@loganj
loganj merged commit 91b4614 into main Oct 2, 2026
22 checks passed
@loganj
loganj deleted the loganj/emergency-agent-control-host-choice branch October 2, 2026 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants