Skip to content

Studio UI gate: retry the composer focus check briefly after the Hub Run settings close - #18984

Merged
danielhanchen merged 1 commit into
mainfrom
fix/model-config-composer-focus-race
Nov 23, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
fix/model-config-composer-focus-race

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Summary

Chat UI Tests (extra) fails intermittently on unrelated PRs at the same step of tests/studio/playwright_model_config.py:

[ui-modelcfg] STEP Hub Run opens run settings on a page loaded at /hub
[ui-modelcfg] OK Hub Run kept run settings open on a page loaded at /hub
[ui-modelcfg] FAIL: composer could not be focused after the Hub Run settings closed

Seen on #18871 (09:37) and #18738 (20:00) today. Neither touches the chat composer or the model picker, and the same suite passes on other runs.

The step presses Escape, waits for the run settings to hide, then calls focus() on the composer in one evaluate and reads document.activeElement in a second. The run settings live in the model picker, a Radix Popover, which returns focus to its trigger as it closes. A focus move like that, landing between the two calls, makes this single attempt fail even though the composer is focusable.

The product behaviour this guards is unchanged: ChatComposerFocusableContext lifts the focus() gate in the same commit that closes the picker, and a real click focuses the composer regardless.

Fix

The check now retries focus() plus the activeElement read for up to 5 s (every 250 ms) through the suite's existing wait_until, and fails with the same message if the composer never takes focus. A composer that stays gated after the settings close still fails the gate.

Only the test changes.

Testing

  • python -m py_compile and ruff check --select F on the driver: clean.
  • The suites that read this driver (CI wiring and Playwright selftests): 213 passed.
  • I could not reproduce the intermittent failure locally, so the timing explanation above is inferred from the two CI logs and the picker's focus handling, not observed directly.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T02:29:19.804770Z f67bea7 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: f67bea792e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen
danielhanchen merged commit d826f77 into main Nov 23, 2026
@danielhanchen
danielhanchen deleted the fix/model-config-composer-focus-race branch November 23, 2026 02:30
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.

1 participant