Repository navigation
Studio: show the models drive in the Live Monitor when it is not the system disk - #12724
Conversation
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. |
|
Both red checks are from this PR, not main:
|
|
Codex Review: Didn't find any major issues. Hooray! 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 review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dfb10c6c7f
ℹ️ 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".
| if usage.total == system.total and abs(usage.free - system.free) < _SAME_POOL_SLACK: | ||
| return None |
There was a problem hiding this comment.
Do not identify shared pools from capacity alone
When the models cache is on a separate disk with the same formatted capacity as the system disk and its free space differs by less than 1 GiB—for example, two newly formatted identical drives—this condition misclassifies the disks as one APFS/btrfs pool and suppresses the new models-disk display. Equal total and similar free values do not establish shared backing storage, so this heuristic needs to be limited to a platform/filesystem where pool sharing can actually be established.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Needs two drives with identical capacity and free space within 1 GiB, and the miss only falls back to the pre-PR display (system disk alone). Keeping the heuristic: it is what stops every Mac and Fedora btrfs host from showing a duplicate tile.
| const modelsDisk = systemInfo.models_disk ?? null; | ||
| const modelsDiskUsed = modelsDisk | ||
| ? Math.max(0, modelsDisk.total_gb - modelsDisk.free_gb) | ||
| : 0; |
There was a problem hiding this comment.
Refresh models-disk data after changing the models folder
When Live updates is disabled, saving a new Models folder updates hfCache but never invalidates or force-refreshes the globally cached systemInfo, so this value continues describing the previous cache volume. Closing and reopening the tab does not reliably fix it because useSystemInfo reuses cachedSystem for non-polled reads; the new row can therefore remain absent or show the old drive until some unrelated forced system fetch or a reload occurs.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
With Live updates off every Resources reading is a snapshot by design; System disk, RAM and VRAM behave the same way. Turning Live updates on or reopening Settings after a reload refreshes it.
…, drop dead search keys
…sence only when proven
|
@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: 83edc74977
ℹ️ 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".
|
|
||
| def _probe(key: str) -> None: | ||
| # Resolving the configured path can block on the same dead mount, so it happens here. | ||
| reading = models_disk_usage() |
There was a problem hiding this comment.
Measure the cache path captured by each probe
If the Models folder changes after cached_models_disk_usage() captures its key but before this worker resolves _hub_cache(), the worker measures the new folder and stores that reading under the old folder's key. Switching back to the old folder within the 30-second TTL then returns the new drive's capacity without re-probing; pass a path snapshot associated with key into the worker so every cached reading describes its own key.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Needs the Models folder to change in the microseconds between the key read and the worker's resolve, then be switched back within 30 s; the worst case is one stale reading for at most one TTL. Below the bar.
|
@codex review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? 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". |
…12749) #12724 added a models-disk tile and storage row with two new keys in en.ts only, so the strict i18n parity step in Frontend build + bundle sanity fails on main. Its fifth MetricTile also broke system-status-verdict.test.ts, which asserted exactly four. Add settings.resources.liveMonitor.modelsDisk and settings.resources.storage.modelsDisk to every locale overlay. Replace the fixed tile count with: at least the four fixed tiles, and every <MetricTile> opening tag captured whole, so the per-tile percentage check still covers every tile, including the conditional one.
Fixes #9259. Supersedes #9261 (thanks @yzxcj797 for the first pass).
Problem
Settings > Resources > Live Monitor and the Storage section read only the root filesystem. When the Hugging Face cache is symlinked to, or configured on, another drive, Studio never shows the drive that actually holds the models.
Change
studio/backend/utils/system_disk.py:models_disk_usage()resolves the active hub cache (get_hf_cache_paths(), so the Models folder setting andHF_HUB_CACHEare honoured) throughos.path.realpathand measures that volume. It returnsNonewhen the cache is on the same device as/, or on a volume sharing/'s pool (APFS Data volume on macOS, btrfs subvolumes such as Fedora's/home: ownst_dev, same size and free space), so single-disk hosts see no change. A cache folder that does not exist yet is measured at its nearest existing parent; an unreadable one is omitted._absence_is_real), so an unreadable cache is omitted rather than reported as its parent volume./api/systemgains an additivemodels_diskfield (total_gb,free_gb,percent_used, ornull).diskstays the system disk, unchanged. No host paths are returned.models_diskis set, the Live Monitor shows a separate "Models disk" tile next to "Disk", and Storage shows a "Models disk" row under "System disk". Each drive keeps its own numbers instead of being summed into one bar.Testing
studio/backend/tests/test_models_disk_usage.py: symlinked cache on a second drive, missing cache dir behind a symlink, cache on the system disk, shared APFS/btrfs pool, cache not created yet, unreadable cache (real chmod 000), a hung probe never blocking the poll, switching away from a hung folder, and (on GitHub-hosted Linux / macOS runners) the real home cache resolving to the system disk. Each functional line was reverted in a scratch copy and fails at least one test./api/systemcall on a host whose HF cache is on a separate volume:disk2079 GB (59.4% used),models_disk30397 GB (77.2% used).npm run typecheckclean; eslint and biome report the same pre-existing findings as main.Screenshots
Settings > System, host with the HF cache on a separate volume. Live Monitor:
Storage section: