Qwen3.8-Flash-Next on any consumer hardware: one-click install for Windows / Linux. Strata inference engine, OpenAI/Anthropic API on localhost, optional image input.
C++
Updates: an interruption that a later finished update settled says so in the same red alert (#3578)
Niko1221e17efa53ce3b
diff --git a/apps/host/src/components/NativeOperations.tsx b/apps/host/src/components/NativeOperations.tsxindex 5a3fcb6c5..ed454fb33 100644--- a/apps/host/src/components/NativeOperations.tsx+++ b/apps/host/src/components/NativeOperations.tsx@@ -6,6 +6,7 @@ import { fetchUpdateCheck, publishUpdateCheck, useInstalledVersions, useLastUpdaimport { nativeAction, useNative, type NativeJob } from '../lib/native';import { Btn, Dialog, ErrorNotice, Select } from './ui';import { NativeProgress } from './NativeModels';+import { jobErrorText } from '../lib/native-job-diagnostics';export function NativeBenchmark({ open, onClose }: {open: boolean;onClose: () => void;@@ -114,7 +115,7 @@ export function NativeOperations() {}return <div className="stack stack--lg native-engine-settings"><section className="st-card"><div className="section-toolbar"><h2 className="h3">{tr("Update component")}</h2>{tr(update === 'available' ? <Btn size="sm" variant="primary" disabled={!!active || (native?.instances.length ?? 0) > 0} onClick={() => setConfirm(true)}>{tr("Update available")}</Btn> : null)}{tr(update !== 'available' ? <Btn size="sm" disabled={update === 'checking'} onClick={() => void checkForUpdates()}>{tr(update === 'checking' ? 'Checking…' : 'Check for updates')}</Btn> : null)}</div><p className="small muted">{tr("Update the engine for this computer. Your models and settings are kept.")}</p>{tr(update === 'current' ? <p className="small muted">{tr("Up to date")}</p> : null)}{tr(checkError ? <p className="small inline-error" role="alert">{tr(checkError)}</p> : null)}{tr(update === 'available' && (native?.instances.length ?? 0) > 0 ? <p className="small muted">{tr("Open Models and unload the running native models first.")}</p> : null)}</section>- <section className="st-card"><div className="section-toolbar"><h2 className="h3">{tr("Diagnostics")}</h2><Btn size="sm" onClick={() => setShowLogs(true)}>{tr("View logs")}</Btn></div><p className="small muted">{tr("Downloads, preparation and engine failures include their original messages here.")}</p>{tr(native?.jobs.filter(j => j.state === 'error').slice(-3).map(j => <ErrorNotice key={j.id} message={j.error ?? j.summary} detail={j.details}/>))}</section>+ <section className="st-card"><div className="section-toolbar"><h2 className="h3">{tr("Diagnostics")}</h2><Btn size="sm" onClick={() => setShowLogs(true)}>{tr("View logs")}</Btn></div><p className="small muted">{tr("Downloads, preparation and engine failures include their original messages here.")}</p>{tr(native?.jobs.filter(j => j.state === 'error').slice(-3).map(j => <ErrorNotice key={j.id} message={jobErrorText(j, native.jobs)} detail={j.details}/>))}</section><Dialog open={showLogs} wide title={tr("Engine logs")} onClose={() => setShowLogs(false)} actions={<><Btn icon="download" disabled={saving} onClick={() => void saveLogs()}>{tr(saving ? 'Working…' : 'Save logs')}</Btn><Btn variant="primary" onClick={() => setShowLogs(false)}>{tr("Close")}</Btn></>}><pre className="native-log" aria-label={tr("Engine log")}>{logs.length ? logs.map(l => `${l.at} · ${l.line}`).join(String.fromCharCode(10)) : tr('No engine messages yet.')}</pre>{tr(saved ? <p className="small" role="status">{tr("Saved to {0}", [saved])}</p> : null)}diff --git a/apps/host/src/components/SettingsUpdates.tsx b/apps/host/src/components/SettingsUpdates.tsxindex 64e38c4e9..1b921f7a7 100644--- a/apps/host/src/components/SettingsUpdates.tsx+++ b/apps/host/src/components/SettingsUpdates.tsx@@ -6,6 +6,7 @@ import { useStore } from '../lib/store';import type { SoftwareUpdate, UpdateCheckResult } from '../lib/types';import { nativeAction, useNative } from '../lib/native';import { NativeProgress } from './NativeModels';+import { jobErrorText } from '../lib/native-job-diagnostics';import { appVersionLabel } from '../lib/app-version';import { fetchUpdateCheck, publishUpdateCheck, useInstalledVersions, useLastUpdateCheck } from '../lib/update-check';/** A check from an earlier day shows its date too, because the result is kept between visits. */@@ -89,7 +90,7 @@ export function SettingsUpdates() {<Btn variant="primary" disabled={component !== 'engine' || !native?.capabilities.rollback || !!active || (native?.instances.length ?? 0) > 0} onClick={() => void operate('rollback')}>{tr("Restore previous engine")}</Btn></div></Dialog>- {tr(active ? <NativeProgress job={active}/> : null)}{tr(native?.jobs.filter(j => j.state === 'error' && ['update-strata', 'update-engine', 'rollback'].includes(j.kind)).slice(-1).map(j => <p role="alert" key={j.id} className="small inline-error">{tr(j.error ?? j.summary)}</p>))}+ {tr(active ? <NativeProgress job={active}/> : null)}{tr(native?.jobs.filter(j => j.state === 'error' && ['update-strata', 'update-engine', 'rollback'].includes(j.kind)).slice(-1).map(j => <p role="alert" key={j.id} className="small inline-error">{tr(jobErrorText(j, native.jobs))}</p>))}<Dialog open={!!confirm} compact title={tr(confirm === 'update-strata' ? 'Update Strata?' : 'Update engine?')} onClose={() => setConfirm('')} actions={<><Btn onClick={() => setConfirm('')}>{tr("Cancel")}</Btn><Btn variant="primary" disabled={!!active || (native?.instances.length ?? 0) > 0} onClick={() => void operate(confirm)}>{tr("Update")}</Btn></>}><p>{tr("The native installer updates the installation. Model files and settings are kept. Unload native models before updating.")}</p>{tr((native?.instances.length ?? 0) > 0 ? <p className="small muted">{tr("Open Models and unload the running native models first.")}</p> : null)}</Dialog></>;}diff --git a/apps/host/src/lib/native-job-diagnostics.ts b/apps/host/src/lib/native-job-diagnostics.tsnew file mode 100644index 000000000..90914b838--- /dev/null+++ b/apps/host/src/lib/native-job-diagnostics.ts@@ -0,0 +1,22 @@+import type { NativeJob } from './native';++/** What the host says about a job a restart cut short. */+export const INTERRUPTED = 'The host restarted before completion. Check diagnostics, then retry; completed files are kept.';+const updateKinds = new Set(['update-strata', 'update-engine']);++/**+ * A later finished update of the same component settles the restart interruption of an earlier one (ported from #3578 by medking82).+ * The records are never changed: a running retry, another component or an ordinary failure stays a plain failure.+ */+export function recoveredInterruptions(jobs: readonly NativeJob[]): Set<string> {+ const time = (job: NativeJob) => Date.parse(job.startedAt);+ return new Set(jobs.filter(job => job.state === 'error' && updateKinds.has(job.kind) && job.error === INTERRUPTED && Number.isFinite(time(job))+ && jobs.some(later => later.state === 'done' && later.kind === job.kind && Number.isFinite(time(later)) && time(later) > time(job))).map(job => job.id));+}++/** The text of a failed job's alert. The alert stays red; an interruption a later update has settled says so in plain words. */+export function jobErrorText(job: NativeJob, jobs: readonly NativeJob[]): string {+ return recoveredInterruptions(jobs).has(job.id)+ ? 'This update was cut short when the app restarted. A later update finished, so nothing needs doing.'+ : job.error ?? job.summary;+}diff --git a/apps/host/src/locales/de.json b/apps/host/src/locales/de.jsonindex e8bc2f9f4..74d0f1b2f 100644--- a/apps/host/src/locales/de.json+++ b/apps/host/src/locales/de.json@@ -3491,5 +3491,6 @@"s8645": "Wird nicht gespeichert, solange Sie die Empfehlung behalten: Strata wählt neu, wenn Sie eine Karte hinzufügen oder entfernen.","s8646": "Nicht genutzt: {0} (anderer Grafikkarten-Hersteller als der, den diese Engine ansteuert).","s8647": "Diese Modelldateien fehlen: {0}.",- "s8648": "Drücken Sie noch einmal auf „Herunterladen und laden“, um sie zu holen. Vorhandene Dateien bleiben erhalten. Werden dieselben Dateien wieder aufgelistet, öffnen Sie die Details und teilen Sie sie mit, wenn Sie um Hilfe bitten."+ "s8648": "Drücken Sie noch einmal auf „Herunterladen und laden“, um sie zu holen. Vorhandene Dateien bleiben erhalten. Werden dieselben Dateien wieder aufgelistet, öffnen Sie die Details und teilen Sie sie mit, wenn Sie um Hilfe bitten.",+ "s8649": "Dieses Update wurde beim Neustart der App unterbrochen. Ein späteres Update ist abgeschlossen, Sie müssen nichts tun."}diff --git a/apps/host/src/locales/en.json b/apps/host/src/locales/en.jsonindex 0586014a9..e5e43f42e 100644--- a/apps/host/src/locales/en.json+++ b/apps/host/src/locales/en.json@@ -3491,5 +3491,6 @@"s8645": "Not saved while you keep the recommendation: Strata picks again if you add or remove a card.","s8646": "Not used: {0} (another make of graphics card than this engine drives).","s8647": "These model files are missing: {0}.",- "s8648": "Press Download & load again to fetch them. Files that are already there are kept. If the same files are listed again, open Details and share them when you ask for help."+ "s8648": "Press Download & load again to fetch them. Files that are already there are kept. If the same files are listed again, open Details and share them when you ask for help.",+ "s8649": "This update was cut short when the app restarted. A later update finished, so nothing needs doing."}diff --git a/apps/host/src/locales/es.json b/apps/host/src/locales/es.jsonindex e75ad6fc2..a4220163e 100644--- a/apps/host/src/locales/es.json+++ b/apps/host/src/locales/es.json@@ -3491,5 +3491,6 @@"s8645": "No se guarda mientras mantengas la recomendación: Strata elige de nuevo si añades o quitas una tarjeta.","s8646": "No se usa: {0} (otra marca de tarjeta gráfica distinta de la que maneja este motor).","s8647": "Faltan estos archivos del modelo: {0}.",- "s8648": "Pulse de nuevo «Descargar y cargar» para obtenerlos. Los archivos que ya están se conservan. Si vuelven a aparecer los mismos archivos, abra los detalles y compártalos cuando pida ayuda."+ "s8648": "Pulse de nuevo «Descargar y cargar» para obtenerlos. Los archivos que ya están se conservan. Si vuelven a aparecer los mismos archivos, abra los detalles y compártalos cuando pida ayuda.",+ "s8649": "Esta actualización se interrumpió cuando la aplicación se reinició. Una actualización posterior terminó, así que no hay nada que hacer."}diff --git a/apps/host/src/locales/ja.json b/apps/host/src/locales/ja.jsonindex ceb9ef226..47633600b 100644--- a/apps/host/src/locales/ja.json+++ b/apps/host/src/locales/ja.json@@ -3491,5 +3491,6 @@"s8645": "おすすめのままの間は保存されません。カードを追加・取り外すと Strata が選び直します。","s8646": "未使用:{0}(このエンジンが対応するのとは別メーカーのカードです)。","s8647": "次のモデルファイルが見つかりません: {0}。",- "s8648": "もう一度「ダウンロードして読み込む」を押すと取得します。すでにあるファイルはそのまま残ります。同じファイルがまた表示される場合は、詳細を開き、助けを求めるときに共有してください。"+ "s8648": "もう一度「ダウンロードして読み込む」を押すと取得します。すでにあるファイルはそのまま残ります。同じファイルがまた表示される場合は、詳細を開き、助けを求めるときに共有してください。",+ "s8649": "このアップデートは、アプリの再起動で中断されました。その後のアップデートが完了しているため、対応は不要です。"}diff --git a/apps/host/src/locales/ko.json b/apps/host/src/locales/ko.jsonindex af85abd04..2facfe1c6 100644--- a/apps/host/src/locales/ko.json+++ b/apps/host/src/locales/ko.json@@ -3491,5 +3491,6 @@"s8645": "추천 설정을 유지하는 동안은 저장되지 않습니다. 카드를 추가하거나 빼면 Strata가 다시 고릅니다.","s8646": "사용 안 함: {0} (이 엔진이 다루는 것과 다른 제조사의 그래픽 카드입니다).","s8647": "다음 모델 파일이 없습니다: {0}.",- "s8648": "'다운로드 및 불러오기'를 다시 누르면 가져옵니다. 이미 있는 파일은 그대로 둡니다. 같은 파일이 다시 표시되면 자세히 보기를 열어 도움을 요청할 때 함께 알려 주세요."+ "s8648": "'다운로드 및 불러오기'를 다시 누르면 가져옵니다. 이미 있는 파일은 그대로 둡니다. 같은 파일이 다시 표시되면 자세히 보기를 열어 도움을 요청할 때 함께 알려 주세요.",+ "s8649": "이 업데이트는 앱이 다시 시작되면서 중단되었습니다. 이후 업데이트가 완료되었으므로 할 일은 없습니다."}diff --git a/apps/host/src/locales/pt.json b/apps/host/src/locales/pt.jsonindex 0d3b20fa9..00de3a412 100644--- a/apps/host/src/locales/pt.json+++ b/apps/host/src/locales/pt.json@@ -3491,5 +3491,6 @@"s8645": "Não é guardado enquanto mantiver a recomendação: o Strata escolhe de novo se adicionar ou remover uma placa.","s8646": "Não usada: {0} (outra marca de placa de vídeo diferente da que este motor controla).","s8647": "Estes arquivos do modelo estão faltando: {0}.",- "s8648": "Pressione Baixar e carregar de novo para buscá-los. Os arquivos que já estão aí são mantidos. Se os mesmos arquivos aparecerem de novo, abra os Detalhes e compartilhe-os ao pedir ajuda."+ "s8648": "Pressione Baixar e carregar de novo para buscá-los. Os arquivos que já estão aí são mantidos. Se os mesmos arquivos aparecerem de novo, abra os Detalhes e compartilhe-os ao pedir ajuda.",+ "s8649": "Esta atualização foi interrompida quando o aplicativo reiniciou. Uma atualização posterior terminou, então não há nada a fazer."}diff --git a/apps/host/src/locales/ru.json b/apps/host/src/locales/ru.jsonindex 03cf462a7..423b459be 100644--- a/apps/host/src/locales/ru.json+++ b/apps/host/src/locales/ru.json@@ -3491,5 +3491,6 @@"s8645": "Не сохраняется, пока вы оставляете рекомендацию: Strata выберет заново, если вы добавите или уберёте карту.","s8646": "Не используется: {0} (другой производитель видеокарт, чем тот, с которым работает этот движок).","s8647": "Не хватает этих файлов модели: {0}.",- "s8648": "Нажмите «Скачать и загрузить» ещё раз, чтобы получить их. Уже имеющиеся файлы сохраняются. Если те же файлы снова появятся в списке, откройте «Подробности» и приложите их, когда будете просить о помощи."+ "s8648": "Нажмите «Скачать и загрузить» ещё раз, чтобы получить их. Уже имеющиеся файлы сохраняются. Если те же файлы снова появятся в списке, откройте «Подробности» и приложите их, когда будете просить о помощи.",+ "s8649": "Это обновление прервалось при перезапуске приложения. Более позднее обновление завершилось, так что делать ничего не нужно."}diff --git a/apps/host/src/locales/zh.json b/apps/host/src/locales/zh.jsonindex 73a6aa0a9..e0679e65f 100644--- a/apps/host/src/locales/zh.json+++ b/apps/host/src/locales/zh.json@@ -3491,5 +3491,6 @@"s8645": "沿用推荐设置时不会保存:增减显卡后 Strata 会重新选择。","s8646": "未使用:{0}(与此引擎驱动的显卡品牌不同)。","s8647": "缺少这些模型文件:{0}。",- "s8648": "再按一次“下载并加载”即可获取。已有的文件会保留。如果再次列出同样的文件,请打开详情,并在求助时一并提供。"+ "s8648": "再按一次“下载并加载”即可获取。已有的文件会保留。如果再次列出同样的文件,请打开详情,并在求助时一并提供。",+ "s8649": "此更新在应用重启时被中断。之后的更新已完成,无需任何操作。"}diff --git a/apps/host/tests/native-job-diagnostics.test.mjs b/apps/host/tests/native-job-diagnostics.test.mjsnew file mode 100644index 000000000..57bbef921--- /dev/null+++ b/apps/host/tests/native-job-diagnostics.test.mjs@@ -0,0 +1,34 @@+/** Ported from #3578 (medking82): a later finished update of the same component settles a restart interruption; the alert stays red. */+import test from 'node:test';+import assert from 'node:assert/strict';+import { build } from 'esbuild';+import { fileURLToPath } from 'node:url';++const out = await build({ entryPoints: [fileURLToPath(new URL('../src/lib/native-job-diagnostics.ts', import.meta.url))], bundle: true, format: 'esm', platform: 'node', write: false, logLevel: 'silent' });+const { recoveredInterruptions, jobErrorText, INTERRUPTED } = await import(`data:text/javascript;base64,${Buffer.from(out.outputFiles[0].text).toString('base64')}`);+const failed = { id: 'a', kind: 'update-strata', state: 'error', summary: 'Interrupted operation', error: INTERRUPTED, startedAt: '2026-10-20T11:41:02.916Z' };+const done = { id: 'b', kind: 'update-strata', state: 'done', summary: 'Complete', error: null, startedAt: '2026-10-20T23:11:18.883Z' };++test('a later finished update of the same component settles the interruption, in any array order, and the records are untouched', () => {+ const jobs = structuredClone([failed, done]), before = JSON.stringify(jobs);+ assert.deepEqual([...recoveredInterruptions(jobs)], ['a']);+ assert.deepEqual([...recoveredInterruptions([done, failed])], ['a']);+ assert.equal(JSON.stringify(jobs), before);+ assert.match(jobErrorText(jobs[0], jobs), /A later update finished, so nothing needs doing/);+});++for (const [name, other] of [['no retry', null], ['running retry', { ...done, state: 'running' }], ['cancelled retry', { ...done, state: 'cancelled' }],+ ['success before the interruption', { ...done, startedAt: '2026-10-19T00:00:00.000Z' }], ['same time', { ...done, startedAt: failed.startedAt }],+ ['invalid time', { ...done, startedAt: 'unknown' }], ['other component', { ...done, kind: 'update-engine' }]]) {+ test(`${name}: the interruption stays an ordinary failure`, () => {+ const jobs = other ? [failed, other] : [failed];+ assert.equal(recoveredInterruptions(jobs).size, 0);+ assert.equal(jobErrorText(failed, jobs), INTERRUPTED);+ });+}++test('an ordinary failure is never settled, and an invalid interruption time stays a failure', () => {+ const other = { ...failed, id: 'c', error: 'Installer Failed' };+ assert.equal(jobErrorText(other, [other, done]), 'Installer Failed');+ assert.equal(recoveredInterruptions([{ ...failed, startedAt: 'unknown' }, done]).size, 0);+});