Repository navigation
studiobench: delete through the reply's More menu, where #12735 moved it - #12748
Conversation
#12735 took Delete off the assistant action bar and made it the last item of the More menu. delete_message still waited for a 'Delete message' button, so the real-path session reported 'delete_message: NOT RUN -- no Delete button' and failed its liveness gate on every pull request. The stop action's cleanup had the same lookup. Open the More menu before the clock starts and select its Delete item; close the menu when the item is missing. Add a node selftest that runs the shipped DELETE_JS through the menu, and a check that every control name the scene asks for is still rendered by thread.tsx.
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fc6ab6b41f
ℹ️ 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".
| // Delete is the More menu's last item since #12735; see DELETE_JS. | ||
| const trigger = D.actionButton("More"); | ||
| if (!trigger) return false; | ||
| const button = (await D.openMenuAndFind(trigger, "Delete", 1000)).item; |
There was a problem hiding this comment.
Reserve time for opening the cleanup menu
When the preceding reply drains near OWN_TURN_RESERVE_MS, stop_generation commits to its throwaway turn using a reserve calculated for the old direct-delete path, but cleanup now adds this menu-open phase, which can wait up to 1,000 ms. That unreserved work can carry the action past its slot and into the following scroll_after window (the fast film leaves only a 300 ms gap), causing a missed slot or contaminating that measurement. Include the menu-open bound in the reserve or constrain this wait to the remaining slot budget.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Agreed, the reserve never priced the menu open. Fixed in 696f25b: the cleanup's menu wait is now bounded by what is left of the slot after the settle and the delete (floor 100 ms, cap 1000 ms). The slot-budget test sweeps a menu that never opens over every drain time on all three films, and fails on fast and quick with a fixed 1000 ms wait.
| await (window.__sbNextPaint | ||
| ? window.__sbNextPaint() | ||
| : new Promise((r) => setTimeout(r, 16))); | ||
| item = D.menuItem(name); |
There was a problem hiding this comment.
Avoid scanning the full DOM in the menu wait loop
When the portaled menu takes one or more paints to mount, every iteration calls D.menuItem(), which calls D.openMenu() and therefore performs a document-wide selector query inside the measured action window. On the large-thread rungs this adds main-thread work proportional to the DOM and biases delete_message frame/jank readings; MENU_JS already uses a MutationObserver specifically to avoid this measurement defect. Observe the body for the portal once, or otherwise avoid repeating a full-document lookup on each paint.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 696f25b: openMenuAndFind now looks for the portal only when a MutationObserver reports body's children changed, then for the item inside the menu. The node selftest mounts the menu three paints late and asserts at most two document-wide lookups; a per-paint lookup fails it.
… by the slot Look for the portaled More menu only when body's children change, then for the item inside it, instead of a document-wide query every paint inside the measured window. The stop action's cleanup now waits for that menu, which OWN_TURN_RESERVE_MS never priced. Bound the wait by what is left of the slot (floor 100 ms, cap 1000 ms) and sweep a menu that never opens over every drain time in the slot-budget test.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 696f25b43f
ℹ️ 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".
| for body in re.findall( | ||
| r"<ActionBarMorePrimitive\.Item\b([\s\S]*?)</ActionBarMorePrimitive\.Item>", tsx | ||
| ): |
There was a problem hiding this comment.
Scope the control check to the assistant menu
If the assistant action bar drops its DeleteMessageMenuItem invocation, this test still passes because the global regex collects Delete from the reusable component's definition, even when that component is no longer rendered there; similarly, More also exists in UserMoreMenu. The scene targets the last assistant message, so this check must verify the assistant bar/menu composition (or rendered DOM) rather than mere label occurrences anywhere in thread.tsx, otherwise the exact regression it is intended to catch remains undetected.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Right, a whole-file search still found Delete in the component definition and More in the user menu. Fixed in bb1c09b: the check now reads AssistantActionBar and the thread.tsx components it renders, transitively. Removing from the assistant bar now fails it with ['Delete'].
…nders The check collected tooltips and More-menu labels from all of thread.tsx, so it still passed if the assistant bar dropped DeleteMessageMenuItem, because the component's own definition and the user message menu still carried the names. Walk AssistantActionBar and the thread.tsx components it renders instead.
|
@codex review |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! 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". |
Summary
Real-path session, every action ranis red on main and on unrelated PRs (for example #12736, #12744 and #12746), always with:Cause
#12735 (tidy the message action bars) moved Delete off the reply's action bar into its More menu, as the last item in red. That is an intended product change. The studiobench scene was not updated:
DELETE_JSstill waits for aDelete messagebutton on the bar, which no longer exists, so the action never runs and the liveness gate fails.STOP_CLEANUP_JS(removing the throwaway turn afterstop) used the same lookup and was silently skipping its cleanup.Changes
dom.js:menuItem(name)andopenMenuAndFind(trigger, name, waitMs). The latter opens a More menu with pointerdown/up (Radix opens on pointerdown, asMENU_JSalready notes) and waits, bounded, for the item.DELETE_JS: waits for the More trigger, opens the menu and finds Delete before the clock starts, then times from selecting Delete to the reply leaving the document, as before. The menu open time is reported separately asmenu_open_ms, sodelete_mskeeps measuring the delete. If the menu has no Delete item it is closed and the action reports why.STOP_CLEANUP_JS: the same route.test_studiobench_delete_through_more_menu.py:DELETE_JSanddom.jsin node against a small DOM shim, covering the delete through the menu, and the "no Delete item" case closing the menu;thread.tsx, so the next move fails here with the control's name instead of as a NOT RUN in a browser job.Verification
tests/studio/studiobench/scene/selftest: all pass.actions.py, all three new tests fail. Renaming the menu item'sDeletelabel inthread.tsxfails the rendered-controls check.