Repository navigation
Studio: lighter system polling and clearer unified-memory monitor - #14592
Conversation
|
@codex security 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: Didn't find any major issues. Already looking forward to the next diff. 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". |
🛡️ Codex Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
|
"Frontend build + bundle sanity" fails here (job 119610693488, base Main is within budget at that base: 2,071,823 B transfer / 6,879,345 B raw (2023.3 / 6718.1 KB) against 2,072,012 / 6,879,589, and no frontend change has landed since #14571 set that. The growth comes from this PR's changes in the startup set ( |
|
Codex Review: Didn't find any major issues. Keep them coming! ℹ️ 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". |
…-audit # Conflicts: # studio/frontend/scripts/check-bundle-budget.ts
Stacked on #14592 (same files); the diff below is against that branch. ## What changes for users **Loaded models card** - **Real model names for image and video rows.** A model loaded from a local snapshot showed `snapshots/<sha>`; rows now show the Hub id the backend already sends as `display_repo_id`. Eject still matches on the real `repo_id`. - **Kept models no longer look idle.** With "Keep multiple models loaded", models answering requests from extra slots were labelled "Still in memory" and treated as inactive. They now show "Also serving" and eject by their own checkpoint, never the active model. - **Memory per model.** The chat, image and video status routes report an additive, best-effort `resident_mib`: - GGUF: llama.cpp's GPU buffers when logged, else the llama-server RSS. - Image and video: the budget the GPU scheduler admitted. Rows append it, e.g. "Chat · GGUF · Q4_K_M · 1.0 GiB". Unknown stays hidden. - **The RAG embedding model is listed** (owner only, while resident) and can be ejected from the card. - **Managed accounts:** when another account's model holds the GPU, the card shows one "In use by another account" row instead of nothing. - **Small fixes:** - Turning the card on with nothing loaded shows "No models loaded" for a few seconds instead of nothing. - An unchanged poll no longer re-renders the card. - The first Enter on the collapsed pill after a header drag is no longer swallowed. - The card's text goes through i18n, in all 14 locales. **Live monitor** - **No more frozen readings.** After two failed polls in a row the values dim and the header says "Reconnecting..." until the server answers again. Before, a dead server left the last numbers on screen as if live. - **No longer covers the Loaded models card.** Both rested in the bottom-right corner, so the monitor hid the card. While the monitor is at its default spot it now rests just above the card; positions you dragged it to are never moved. - **Keyboard and screen readers.** - Both panels are labelled regions, and Esc closes them when focus is inside. - The drag handles are focusable and labelled; arrow keys move the panel (Shift for bigger steps). - Double-click the monitor's handle to put it back in its corner, and a drop within 16 px of the corner snaps back. ## How it was verified - **Frontend:** `npm run typecheck`, `npm run i18n:check:strict`, the full `npm test` (13423 pass, 0 fail) and `npm run build` all pass. New tests: `loaded-models-floating-polish`, `loaded-models-eject-serving`, `floating-monitor-polish`, plus a case in `loaded-models-dismiss`. - **Backend:** new `tests/test_loaded_model_resident_mib.py`; related status and media tests pass (390). `ruff check` is clean. - **Live on an M3 Max** with `unsloth/Qwen3-0.6B-GGUF` Q4_K_M loaded through llama.cpp: - `/api/inference/status` returns `resident_mib: 983`, and the card row reads "Chat · GGUF · Q4_K_M · 1.0 GiB". - With both panels open their boxes do not overlap. - Arrow keys move the monitor, double-click returns it to the corner, and Esc closes it. - Stopping the server mid-session turns the monitor to "Reconnecting...", and no llama-server process is left behind. Both panels with a model loaded:  The monitor after the server stops:  ## Not tested here - Image and video sizes and labels, extra-slot "Also serving" rows, the CUDA GPU-buffer path, and the managed-account row. These need GPU models or a second account with a resident model; they are covered by unit tests only. - Some row details are still English: kind labels ("Chat", "Image") and runtime names ("GGUF", "BF16") come from a pure sources module whose tests assert on them.
…-audit # Conflicts: # studio/frontend/scripts/check-bundle-budget.ts
…o studio-system-monitor-audit # Conflicts: # studio/frontend/scripts/check-bundle-budget.ts
…-audit # Conflicts: # studio/frontend/scripts/check-bundle-budget.ts
|
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". |
The Loaded models card polls /api/inference/status every 5 s, and resident_mib rescanned the whole stdout buffer (up to 20k lines on a busy server) on the event loop each time. The model buffer lines are startup output, so the answer is fixed once the server is healthy: memoise it per process.
|
Codex Review: Didn't find any major issues. Swish! 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". |
…ds mid-case (#14647) The composer icon alignment step in Studio Frontend CI fails intermittently on the Windows leg with: ``` File "tests/studio/playwright_composer_icons.py", line 99, in main page.evaluate( playwright._impl._errors.Error: Page.evaluate: Execution context was destroyed, most likely because of a navigation ``` Seen on main (run 39678763807, job 119495424607) and on #14592 (job 119703801606), which does not touch the composer, the smoke page or the script. The vite dev page navigates after its buttons have rendered, and the next evaluate loses its context. ### Change - Each display case (font scale, zoom, dark, direction) is now applied and measured in one `evaluate`. Before, the case was applied in one call and measured in a second; a reload between them resets the case, so retrying only the measurement would record the default layout under the case's name. - `measure_case` re-runs the whole case on a fresh render when the context is lost, up to 3 attempts. Any other evaluate error fails at once, and a page that keeps navigating still fails. - When it does re-measure, it prints the dev server's recent output so the next occurrence names what triggered the reload. I could not reproduce the reload on Linux with a cold `node_modules/.vite`, so the trigger on Windows is not proven yet. ### Verification - `tests/studio/test_composer_icons_navigation.py` (new, collected by the Backend CI `studio` shard) uses a fake page whose reload resets the applied case and kills the evaluate in flight. It checks that one evaluate applies and measures, that a reload on the first or second attempt still returns the requested case, that persistent navigation fails after 3 attempts, and that other errors are not retried. - Against main's script: 5 of 5 fail. Against a naive fix that keeps the separate apply call and retries only the measurement: 3 of 5 fail, including the reload mid-case test. - Ran the real driver locally in Chromium: `PASS: 1296 rendered icons centered`, and the measured widths scale with each case (20.80 at font 1 / zoom 1, 32.5 at 1.25 / 1.25), so the case is applied inside the measuring call. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
|
@codex review |
# Conflicts: # studio/frontend/scripts/check-bundle-budget.ts # studio/frontend/tests/loaded-models-drag-restore.test.ts # studio/frontend/tests/on-device-dot-and-header-alignment.test.ts [skip ci]
|
@codex review |
1 similar comment
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 50c7c69ebf
ℹ️ 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".
| const heldByOther = heldByAnotherAccount([ | ||
| inference as { yours?: boolean } | null, | ||
| diffusion as { yours?: boolean } | null, | ||
| video as { yours?: boolean } | null, | ||
| ]); |
There was a problem hiding this comment.
Preserve hidden-resident state across failed polls
When a managed account is showing the “in use by another account” card, any transient failure or timeout from the status endpoint that supplied yours: false turns that result into null, so heldByAnotherAccount returns false and the card disappears even though the resident is still holding memory. The row-preservation logic above correctly treats an unreadable source as no new evidence; the hidden-resident verdict needs equivalent per-source preservation until that source returns a successful status.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Leaving as is: one failed poll hides the card until the next successful one a few seconds later; it is a display card, and nothing is unloaded or lost.
| const heldByOther = heldByAnotherAccount([ | ||
| inference as { yours?: boolean } | null, | ||
| diffusion as { yours?: boolean } | null, | ||
| video as { yours?: boolean } | null, |
There was a problem hiding this comment.
Include hidden STT residents in the other-account verdict
When another managed account owns a dictation sidecar, /api/inference/audio/stt/status reports loaded: true, yours: false inside the affected transformers, mtmd, gguf, or audiocpp block while clearing loaded_model. describeSttStatus therefore produces no row, and because this check examines only the chat, image, and video top-level statuses, heldByOther remains false and the card incorrectly disappears even though the foreign STT model still reserves memory.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Leaving as is: it needs a managed account viewing while another account holds only a dictation sidecar; the card covers chat, image and video residents, which is what users load and eject from it.
|
Codex Review: Didn't find any major issues. Swish! 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". |
# Conflicts: # studio/frontend/scripts/check-bundle-budget.ts
What changes for users
/api/systemfrom hidden tabs; it polls once as soon as the tab is visible again. Before, opening the monitor once (its open state is saved) meant every Studio tab, including background ones, sent 12 requests a minute forever./api/systemrequests now time out after 15 s, so a hung request can no longer freeze the monitor or block the model picker's memory refresh.How it was verified
npm run typecheck,npm test(13402 pass, 0 fail),npm run build. New tests:system-poll-visibility,export-backend-status-identity, plus cases ingpu-memory-display,dense-quant-schemes-identity,export-status-poll-stall-guard,resources-shared-memory-display,on-device-dot-and-header-alignment./api/systemrequests, and one request fired immediately when the tab became visible again.Live Monitor on an M3 Max after this change (no model loaded):
Not tested here
Before / after
Two isolated Studio installs, BEFORE at the merge base and AFTER at this branch's head, both answering
/api/systemwith the same Apple M3 Max reading (64 GiB unified memory, 7.02 GiB in use, 17.9 GiB available), since this machine has no Apple GPU. Only the frontend rendering of that one reading differs.Live Monitor: the VRAM row no longer reads "7.02 GiB / 0.00 GiB VRAM + 64.0 GiB shared"; it reads "7.02 GiB / 64.0 GiB", "Shared with system RAM" and "Estimated available: 17.9 GiB".
Settings > System: the VRAM card matches the monitor.