Repository navigation
Studio: do not call the host CPU-only before the System tab has read anything - #9315
Conversation
useSystemInfo starts on a placeholder that says cpu backend, no GPU, zero cores and zero RAM, and the System tab renders it as a verdict: "No visible GPU detected. CPU-only resources are shown above." A user who opens Settings before /api/system answers, or whose request fails, is told their GPU is not being used. Carry a client-side loaded flag on the response and show that the check is still running until it lands.
Codex P2 on unslothai#8863: the loaded flag only ever flipped on success, so a single failed /api/system with polling off left the System tab saying "Checking for GPUs..." forever, with nothing retrying it. shouldRetrySystemDiscovery bails at retrySubscribers <= 0 and useSystemInfo's finally returns early without pollMs, so no request was coming. Replace the flag with a three-state status. A settled failure moves the placeholder to unavailable and the tab says it could not read the hardware, which is true and does not promise a check that is not running. Data already on screen survives a later failed poll rather than being blanked.
Frontend CI's locale parity gate is strict: a key added only to en.ts falls back to English at runtime, so nothing breaks and nothing complains, which is how the overlays drifted before. The System tab's "still checking" and "could not read this host" lines landed in en.ts alone and failed the gate.
|
Confirmed this hits resources-tab.tsx where the System tab renders the pre-fetch placeholder as "No visible GPU detected", and the new status gate on useSystemInfo separates still checking from settled empty. Will get this reviewed. |
useSystemInfo pulls through fetchSystemInfo but never joined the subscriber bus, and the status a failed read settles at lives only in the hook. So a tab that settled unavailable stayed there for the life of the mount even after the shared cache went ready: nothing retries a placeholder once its own request has settled, and with live updates off nothing polls either. Subscribe to the bus use-gpu-info.ts already uses. A placeholder takes the published snapshot; a reading already on screen is left to this hook's own poll, which the live-updates switch governs.
The placeholder's device_backend is cpu and its package list is empty, so two sections below the gated text the tab still read Backend: CPU and Torch: Not installed before the host had been read. Same false verdict, same tab. Also carry both MetricTile lines as a title. They truncate in a half-width tile, and the settled-failure string is a sentence, so it was cut with no way to recover it. InfoRow already does this.
system-discovery.test.ts covers settledFailureStatus, which is three lines. It cannot fail for the bug this guards: revert the gate in resources-tab.tsx to its pre-fix form and those cases still pass, and so do they if the identity short-circuit that keeps a reading on screen is deleted. Lift the verdict and both setSystemInfo callbacks out of their sources and evaluate them, the way chat-only-route-guard.test.ts lifts the route guard out of __root.tsx.
The Live monitor's CPU, RAM and disk tiles folded every missing reading to 0, so an unread host rendered 0 GiB / 0 GiB and a 0% meter beside a VRAM tile that had just said Unknown. MetricTile already takes percent null for a usage it must not fabricate, which is exactly this. Their detail line takes common.loading rather than the GPU wording: Checking for GPUs beside a RAM reading is the wrong sentence. The failure string already speaks of the whole host.
|
Reviewed this and pushed four commits to the branch rather than leaving a list of asks. The core of the PR is right and the bug is real: the first What I pushed: 1. 2. The Environment rows now wait for the same read. Two sections below the gated text, the tab still read 3. The other three tiles too. CPU, RAM and disk folded every missing reading to 0, so an unread host rendered Also added 4. A test that can actually fail. Verification, all on this head:
Left alone deliberately, worth follow-ups rather than growing this PR:
Thanks for splitting this out of #8863, it made it much easier to review. |
|
@codex review |
|
Codex Review: Didn't find any major issues. You're on a roll. 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". |
|
Ran the frontend CI set on an AMD DevLab runner at the merge commit
Both failures reproduce identically at the parent, so they pre-date this change and are not caused by it. The failing test is Worth raising separately though: this means |
useSystemInfo's placeholder says cpu backend, no GPU, zero everything, and the System tab rendered it as "No visible GPU detected. CPU-only resources are shown above." Opening Settings before/api/systemanswered told an AMD user their card was unused.A client-side status gates that verdict behind having read something, and distinguishes the two non-answers: still checking, or asked and got nothing back. The second matters because with polling off nothing retries, so "still checking" would outlive the check. Data already on screen is never blanked by a failed poll; only a placeholder moves, off "pending".
The two new strings are in every locale overlay, so the strict parity gate passes.
Tests
Two cases added to
system-discovery.test.ts: a settled failure leaves the placeholder rather than a live check, and a settled failure does not blank a reading already on screen. Locale parity clean.Split out of #8863 at review request. Pure frontend, independent of the other three.