[PR #4462] [CLOSED] [GUI] Open on the models this computer already has, not a false setup screen #5057

Closed
opened 2026-11-07 16:32:22 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/4462
Author: @xvcezrqpbxtpzblrt
Created: 10/28/2026
Status: ❌ Closed

Base: main ← Head: gui/models-first-screen-027


📝 Commits (1)

  • a18f5be [GUI] Open on the models this computer already has, not a false setup screen

📊 Changes

3 files changed (+25 additions, -3 deletions)

View changed files

📝 apps/host/server/native-control.mjs (+9 -2)
📝 apps/host/src/components/NativeModels.tsx (+14 -1)
📝 apps/host/src/lib/native.ts (+2 -0)

📄 Description

Problem

Every start opened the Models page on a screen that was not true:

  • "Set up Strata / Connect engine" — for a computer that has the engine and a model;
  • "this installation reports no supported graphics card" — for a PC with an RTX card.

A few seconds later the page jumped to the installed model. The cause is in the host: its first snapshot says available: false with the sentence "Connect a local Strata installation" before it has read anything, and the first read of the installation can take many seconds (measured here: the first /api/native answer came after about 30 s on a cold start). The page could not tell "not read yet" from "nothing installed", so it rendered the setup state.

Result

  • The host's snapshot says checking: true until the first look at the installation ends; available: false before that no longer claims "nothing is installed".
  • The last good snapshot is written to native-snapshot.json (only when it changes) and loaded at the next start, so the page opens on the models this computer already has while the fresh read runs behind it. A model deleted outside Strata disappears when that read ends.
  • The Models page: with a known snapshot it renders at once; without one it says "Loading your models and settings…" instead of offering setup; the setup card appears only when the host is really offline or the read says there is no engine.

Validation

  • Before: a poll of /api/native right after start returned nothing for 30 s, and the Models page showed the setup card for that time.
  • Without a cache (first start after install): the page shows "正在加载模型和设置…" from the first frame, never the setup card, until the read ends. Screen captured.
  • With the cache (next start): the Models page shows "Swift IQ3_XXS 已下载" at the first check, and the context/KV settle to 512K / K8V4 as the stored settings are applied. Screen captured.
  • npm run typecheck clean; node --test tests/packaged-control.test.mjs tests/ui4-fixes.test.mjs → 33 pass, 0 fail.

Limits

  • The cached snapshot is a few seconds old at most on a normal start; a model deleted while Strata was closed is shown briefly and then removed by the read.
  • The first run after a fresh install has no cache: it shows the loading line for as long as the first read takes (about 6 s warm, 30 s cold on this PC). Shortening that read is a separate change.
  • Only the Models page is gated; other screens still update their own native figures when the read ends.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/4462 **Author:** [@xvcezrqpbxtpzblrt](https://github.com/xvcezrqpbxtpzblrt) **Created:** 10/28/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `gui/models-first-screen-027` --- ### 📝 Commits (1) - [`a18f5be`](https://github.com/Niko1221/Strata/commit/a18f5be46a362b79ce06b6fc4f7285fa07a1d60c) [GUI] Open on the models this computer already has, not a false setup screen ### 📊 Changes **3 files changed** (+25 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `apps/host/server/native-control.mjs` (+9 -2) 📝 `apps/host/src/components/NativeModels.tsx` (+14 -1) 📝 `apps/host/src/lib/native.ts` (+2 -0) </details> ### 📄 Description ## Problem Every start opened the Models page on a screen that was not true: - "Set up Strata / Connect engine" — for a computer that has the engine and a model; - "this installation reports no supported graphics card" — for a PC with an RTX card. A few seconds later the page jumped to the installed model. The cause is in the host: its first snapshot says `available: false` with the sentence "Connect a local Strata installation" before it has read anything, and the first read of the installation can take many seconds (measured here: the first `/api/native` answer came after about 30 s on a cold start). The page could not tell "not read yet" from "nothing installed", so it rendered the setup state. ## Result - The host's snapshot says `checking: true` until the first look at the installation ends; `available: false` before that no longer claims "nothing is installed". - The last good snapshot is written to `native-snapshot.json` (only when it changes) and loaded at the next start, so the page opens on the models this computer already has while the fresh read runs behind it. A model deleted outside Strata disappears when that read ends. - The Models page: with a known snapshot it renders at once; without one it says "Loading your models and settings…" instead of offering setup; the setup card appears only when the host is really offline or the read says there is no engine. ## Validation - Before: a poll of `/api/native` right after start returned nothing for 30 s, and the Models page showed the setup card for that time. - Without a cache (first start after install): the page shows "正在加载模型和设置…" from the first frame, never the setup card, until the read ends. Screen captured. - With the cache (next start): the Models page shows "Swift IQ3_XXS 已下载" at the first check, and the context/KV settle to 512K / K8V4 as the stored settings are applied. Screen captured. - `npm run typecheck` clean; `node --test tests/packaged-control.test.mjs tests/ui4-fixes.test.mjs` → 33 pass, 0 fail. ## Limits - The cached snapshot is a few seconds old at most on a normal start; a model deleted while Strata was closed is shown briefly and then removed by the read. - The first run after a fresh install has no cache: it shows the loading line for as long as the first read takes (about 6 s warm, 30 s cold on this PC). Shortening that read is a separate change. - Only the Models page is gated; other screens still update their own native figures when the read ends. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 16:32:22 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#5057
No description provided.