Repository navigation
Studio: keep the live generation line from moving the branch picker, and update it during short replies - #16449
Conversation
…and update it during short replies
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. |
|
Review record for #16449, carried over from the mirror it was reviewed on: danielhanchen/unsloth-staging-review#684. Findings are quoted as posted and attributed to the account that posted them. The reactions shown are the triage recorded on the mirror; none were re-applied here. Commits are named as the mirror's, with this PR's equivalent where one was found. Round 1: reviewed mirror
|
A review of #14909 reported that the reply footer "looks buggy" while a reply streams, with Generation details on. A screen recording shows two separate defects.
Problem
< 2/2 >picker shifts right when the live line appears, shifts further as the line grows, and snaps back to the left when the reply finishes. In a narrow chat column the line pushes the picker onto a second row.Cause
AssistantMessageTime,LiveGenerationLine,BranchPicker,AssistantActionBarin that order, so the growing live line sits before the picker._PrefillProgressSignalsends a decode frame at most once per_LIVE_DECODE_FRAME_INTERVAL_S = 1.0, and the first sample goes out at once. That sample is llama-server's first token, which has no decode rate yet, and it holds the line until the interval runs out. The next sample's rate covers one decode step, which with Studio's default draft model reads about 10x low.Fix
thread.tsx: the live line renders after the picker, in the slot the hidden action bar leaves while streaming, so its text never moves the picker. The footer's picker takes the row's 32 px height (h-8), so it also stays put when the live line wraps onto a row of its own.routes/inference.py: a pass's first decode sample opens the interval instead of being sent, and samples without a rate are dropped, so the first frame goes out one interval into decoding with a measured rate. A new prompt pass (the next round of a tool loop) starts its own wait. The interval drops from 1.0 s to 0.25 s, the stall poll's period.Behavior boundaries
Verification
Live A/B with Playwright on fresh Studio homes, gemma-3-270m-it UD-Q4_K_XL on the CPU, Generation details on; main was
d8efd157abfor the measurements and6401ceda29for the screenshots. Each run regenerated a reply so the picker shows.Tests:
generation-detailsandreply-times-preference: 25 passed. Typecheck passes; ESLint has no new findings.The contributor's original checks did not cover GPU hosts, macOS or Windows. Additional takeover checks: 111 targeted backend tests and 25 frontend tests passed locally; scoped staging ran 11 backend and 21 frontend tests successfully on each of Linux, macOS and Windows. An exclusive remote Tesla T4 tiny-model run exercised the production live-progress callback: greedy outputs matched in all 15 runs, peak allocated memory was equal, and the 1.51% median decode change was within repeated-base variation. This measures callback overhead during inference, not full Studio HTTP/persistence throughput. Chromium, Firefox and Edge each reproduced the base layout defect and stable head picker; the WebKit scripted-stream fixture failed on base with access-control errors, so no WebKit pass is claimed. The switchboard finished at exact head
9fcbf6b750with CURRENT / NO_REGRESSION: 66 SAME, 4 DOM_ONLY_DIFF, 1 FAIL_BOTH and 2 FLAKY. The shared failure is the compaction notice not appearing after six turns on both arms; no compaction correctness claim is made. The remote model journeys ran on a Colab T4-HM.Screenshots
The footer while the reply streams, 0.6 s and 1.6 s after the live line appears, then finished:
The same at 400 px:
Verified footer layout
Fresh, isolated Studio builds at merge base
6401ceda29and functional PR head9fb03a89a, with the same scripted reply and progress frames. The later commits through9fcbf6b750change comments and an internal docstring only, verified by the comment-only AST checks. This image verifies layout; backend timing is covered separately by the base/head progress tests.The picker moves 347.8 to 467.1 px to the right as the live text grows on the base, and stays at x=0 on the PR. At 400 px the base puts the picker below the wrapped live line; the PR keeps it above the line at y=0. Both replies contain exactly "A short reply for the footer check."