Skip to content

The all-in-one local AI studio for your desktop: chat, image and video generation and a coding agent in one free, open source app. Windows and Linux. No Docker, no terminal, no cloud required.

fix(ci): literal platform in four specs, dev stubs for the two new desktop commands

purple77a86f00bc51
diff --git a/dev-server/remote-stubs.ts b/dev-server/remote-stubs.ts
index 0895dc30..d0bab5b0 100644
--- a/dev-server/remote-stubs.ts
+++ b/dev-server/remote-stubs.ts
@@ -45,4 +45,19 @@ export function registerRemoteStubs(routes: RouteMount): void {
for (const path of remoteStubPaths) {
routes.use(path, remoteDevModeStub)
}
+
+ // The Local API usage counter (local_api_usage) and the download speed
+ // limit (set_download_limit) live in the Rust process as well. Both callers
+ // already tolerate a failure: the panel shows no numbers, and the limit is
+ // only sent from the desktop app.
+ const DESKTOP_ONLY_BODY = JSON.stringify({
+ error: 'This needs the installed desktop app. The plain vite dev server has no Rust backend.',
+ devModeOnly: true,
+ })
+ for (const path of ['/local-api/local-api-usage', '/local-api/set-download-limit']) {
+ routes.use(path, (_req, res) => {
+ res.writeHead(501, { 'Content-Type': 'application/json' })
+ res.end(DESKTOP_ONLY_BODY)
+ })
+ }
}
diff --git a/e2e/gallery-download-saves-the-file.spec.ts b/e2e/gallery-download-saves-the-file.spec.ts
index 09c6f39c..09eb2caa 100644
--- a/e2e/gallery-download-saves-the-file.spec.ts
+++ b/e2e/gallery-download-saves-the-file.spec.ts
@@ -12,7 +12,7 @@ import { seedOnboardingDone } from './support/cloud-mock'
const FILE = 'red_apple_on_a_plate_k3f9q2_00001_.png'
test('Download in the gallery strip opens the native Save dialog with the render', async ({ page }) => {
- await page.addInitScript(tauriMockInit, { assistantReply: DEFAULT_ASSISTANT_REPLY, modelName: DEFAULT_MODEL_NAME, platform: 'windows' })
+ await page.addInitScript(tauriMockInit, { assistantReply: DEFAULT_ASSISTANT_REPLY, modelName: DEFAULT_MODEL_NAME, platform: 'windows' as const })
await seedOnboardingDone(page)
await page.addInitScript(([file]) => {
localStorage.setItem('create-store', JSON.stringify({
diff --git a/e2e/installed-models-show-their-file-format.spec.ts b/e2e/installed-models-show-their-file-format.spec.ts
index 63f7ac8d..b0972f0e 100644
--- a/e2e/installed-models-show-their-file-format.spec.ts
+++ b/e2e/installed-models-show-their-file-format.spec.ts
@@ -9,7 +9,7 @@ import { seedOnboardingDone } from './support/cloud-mock'
* .safetensors, and the cards must name each file's own format.
*/
test('an installed .ckpt is labelled ckpt, a .safetensors safetensors', async ({ page }) => {
- await page.addInitScript(tauriMockInit, { assistantReply: DEFAULT_ASSISTANT_REPLY, modelName: DEFAULT_MODEL_NAME, platform: 'windows' })
+ await page.addInitScript(tauriMockInit, { assistantReply: DEFAULT_ASSISTANT_REPLY, modelName: DEFAULT_MODEL_NAME, platform: 'windows' as const })
await seedOnboardingDone(page)
await page.addInitScript(() => {
const bridge = (window as unknown as { __TAURI_INTERNALS__: { invoke: (c: string, a: { url?: string }) => Promise<unknown> } }).__TAURI_INTERNALS__
diff --git a/e2e/lora-stack-follows-the-folder.spec.ts b/e2e/lora-stack-follows-the-folder.spec.ts
index ef6f72a7..b8c305c0 100644
--- a/e2e/lora-stack-follows-the-folder.spec.ts
+++ b/e2e/lora-stack-follows-the-folder.spec.ts
@@ -15,7 +15,7 @@ const STYLE = 'film_grain_xl.safetensors'
const CHAR = 'char_mira_zimage.safetensors'
async function bootWithFakeComfy(page: Page, loras: string[], imageModel: string) {
- await page.addInitScript(tauriMockInit, { assistantReply: DEFAULT_ASSISTANT_REPLY, modelName: DEFAULT_MODEL_NAME, platform: 'windows' })
+ await page.addInitScript(tauriMockInit, { assistantReply: DEFAULT_ASSISTANT_REPLY, modelName: DEFAULT_MODEL_NAME, platform: 'windows' as const })
await seedOnboardingDone(page)
await page.addInitScript(([list, model, stale]) => {
const w = window as unknown as { __LORAS__: string[]; __TAURI_INTERNALS__: { invoke: (c: string, a: { url?: string }) => Promise<unknown> } }
diff --git a/e2e/no-download-offer-while-comfyui-starts.spec.ts b/e2e/no-download-offer-while-comfyui-starts.spec.ts
index 73f17258..6e53b042 100644
--- a/e2e/no-download-offer-while-comfyui-starts.spec.ts
+++ b/e2e/no-download-offer-while-comfyui-starts.spec.ts
@@ -12,7 +12,7 @@ import { seedOnboardingDone } from './support/cloud-mock'
*/
async function boot(page: Page, starting: boolean) {
- await page.addInitScript(tauriMockInit, { assistantReply: DEFAULT_ASSISTANT_REPLY, modelName: DEFAULT_MODEL_NAME, platform: 'windows' })
+ await page.addInitScript(tauriMockInit, { assistantReply: DEFAULT_ASSISTANT_REPLY, modelName: DEFAULT_MODEL_NAME, platform: 'windows' as const })
await seedOnboardingDone(page)
await page.addInitScript((s) => {
const bridge = (window as unknown as { __TAURI_INTERNALS__: { invoke: (c: string, a: unknown) => Promise<unknown> } }).__TAURI_INTERNALS__
diff --git a/src/api/backend.ts b/src/api/backend.ts
index acd6987b..849f0e7b 100644
--- a/src/api/backend.ts
+++ b/src/api/backend.ts
@@ -520,6 +520,10 @@ export async function backendCall<T = unknown>(
// gives. See dev-server/mlx-media-stubs.ts for the shared stub handler
// and its reasoning; the systematic check behind this list is
// dev-server/__tests__/mlx-media-endpoint-coverage.test.ts.
+ // Desktop only, answered by a 501 stub in dev-server/remote-stubs.ts:
+ // the Local API usage counter and the download speed limit live in Rust.
+ local_api_usage: { path: "/local-api/local-api-usage" },
+ set_download_limit: { path: "/local-api/set-download-limit", method: "POST" },
mlx_status: { path: "/local-api/mlx-status" },
mlx_start: { path: "/local-api/mlx-start", method: "POST" },
mlx_unload: { path: "/local-api/mlx-unload", method: "POST" },