Repository navigation
Read the IME re-arm flush off the live composer - #8401
Conversation
The IME probe's watchdog re-arm step (#5546 follow-up) captured the textarea before the submit and read its value afterwards. A send in a new chat swaps the empty-thread view for the thread view, so React unmounts that node and mounts a fresh one. Since #8136 rendered the send without waiting on persistence, the swap lands inside the 250ms settle window and the detached node keeps the composed text forever, which the step reported as "Send stayed permanently locked" on a build that sent the message. The step now re-reads the composer that is on screen and requires the user message to have rendered, so a genuinely blocked submit (text left in the live composer, no message) still fails it. The same send answers "does this thread / message row exist yet" with a GET that 404s until the row lands, which the browser logs as a console.error with no URL in its text. Those two reads are matched on the failing resource's URL from the console message's location and skipped; every other console error still fails the probe.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c5f3c92fb3
ℹ️ 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".
| EXPECTED_404_URL_RES = ( | ||
| re.compile(r"/api/chat/threads/[^/?#]+$"), | ||
| re.compile(r"/api/chat/threads/[^/?#]+/messages/[^/?#]+$"), | ||
| ) |
There was a problem hiding this comment.
Restrict the 404 exemption to the expected GETs
These patterns suppress every 404 for the matching resource paths, regardless of request method or whether it was one of the two anticipated existence reads. In particular, saveChatMessage() issues a persistence PUT to /api/chat/threads/{threadId}/messages/{messageId} and updateChatThread() issues a PATCH to /api/chat/threads/{threadId}; a 404 from either write now disappears from the probe's strict console validation, while the optimistic user bubble checked below can still make the send appear successful. Track and exempt only the expected GET responses, including their method and bounded count, so failed writes remain visible.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Correct, and fixed in 46bb61b. The URL patterns alone did not identify the reads: a persistence PUT or PATCH to the very same thread path 404s on exactly those regexes, so a genuine failure to save would have been swallowed silently.
The exemption is now resolved against the response ledger rather than the URL. A response listener records every 404 whose request method is GET and whose URL matches, and a console 404 is forgiven only if there is an unspent GET recorded at that URL; forgiving one spends it, so the count is bounded by what actually happened rather than unbounded. Ordering between the response event and the console error is not guaranteed by Playwright, so resolution runs once at the end instead of inline.
On verification I should be straight: I could not exercise this end to end on this box. The probe fails here at the composer-idle step, but it fails identically at the parent commit d87fc5e with the exact same message, so that is a pre-existing local environment difference and not something either this item or the PR introduced. CI is the real check.
The exemption matched on URL alone, but a persistence PUT or PATCH to the same thread path 404s on exactly those patterns, so a genuine failure to save would have been swallowed. Resolve each console 404 against the response ledger instead: forgive one only when a real GET returned 404 at that URL, and spend that GET so the count stays bounded. Ordering between the response event and the console error is not guaranteed, so resolution runs once at the end rather than inline.
|
@codex review |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Chat UI Testsfails on main at the IME probe's step 6d:The premise is false. Instrumenting the composer hook shows the keydown re-pin does re-arm the watchdog, the watchdog fires, the gate opens and the message is sent:
What step 6d read was a textarea React had already unmounted: same_node false, stale_connected false, live_value "", Stop button up. A send in a new chat swaps the empty-thread view for the thread view, so the node the step composed into is discarded still holding the text.
Bisected to 5c332c3 ("render a chat send without waiting on persistence", #8136). At 5c332c3^ the step passes with after ""; at 5c332c3 it fails with after "你好" and live_value "". The composer node was always swapped on the first send; #8136 moved the swap earlier, into the step's 250 ms settle window.
Two changes, both in the probe:
Negative control: deleting refreshStuckTimer() from the keydown re-pin branch and rebuilding makes the fixed step fail again with "Live composer still '你好', message delivered=False". So it still catches the lock-up it is named for.
No app code changed, so the browser and OS matrix is untouched. Also run: tests/studio/test_composer_rtl_bidi_attribute.py (the static guard for this same area), test_stt_model_search_locator_contract.py and test_first_turn_thread_identity.py, 38 passed; ruff clean.
Worth a separate look, not fixed here: #8136 makes the frontend GET a thread id it just minted locally before the POST that creates it, so every new chat costs a guaranteed 404 round trip and dirties the browser console.