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(app): an agent keeps working while LU's window is hidden or covered (CA)

purplea4d650292358
diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json
index 9948fd3e..01a381f7 100644
--- a/src-tauri/tauri.conf.json
+++ b/src-tauri/tauri.conf.json
@@ -21,7 +21,8 @@
"visible": false,
"decorations": false,
"transparent": true,
- "dragDropEnabled": false
+ "dragDropEnabled": false,
+ "backgroundThrottling": "disabled"
}
],
"security": {
diff --git a/src-tauri/tauri.linux.conf.json b/src-tauri/tauri.linux.conf.json
index 21866470..4ca12c44 100644
--- a/src-tauri/tauri.linux.conf.json
+++ b/src-tauri/tauri.linux.conf.json
@@ -12,7 +12,8 @@
"visible": false,
"decorations": false,
"transparent": false,
- "dragDropEnabled": false
+ "dragDropEnabled": false,
+ "backgroundThrottling": "disabled"
}
]
},
diff --git a/src-tauri/tauri.macos.conf.json b/src-tauri/tauri.macos.conf.json
index 4cb51e51..2dc14fb1 100644
--- a/src-tauri/tauri.macos.conf.json
+++ b/src-tauri/tauri.macos.conf.json
@@ -13,7 +13,8 @@
"transparent": false,
"titleBarStyle": "Overlay",
"hiddenTitle": true,
- "dragDropEnabled": false
+ "dragDropEnabled": false,
+ "backgroundThrottling": "disabled"
}
]
},
diff --git a/src-tauri/tauri.windows.conf.json b/src-tauri/tauri.windows.conf.json
index 83df0bd5..5ddef57f 100644
--- a/src-tauri/tauri.windows.conf.json
+++ b/src-tauri/tauri.windows.conf.json
@@ -12,7 +12,8 @@
"visible": false,
"decorations": false,
"transparent": true,
- "dragDropEnabled": false
+ "dragDropEnabled": false,
+ "backgroundThrottling": "disabled"
}
]
},
diff --git a/src/lib/__tests__/an-agent-keeps-running-in-a-hidden-window.test.ts b/src/lib/__tests__/an-agent-keeps-running-in-a-hidden-window.test.ts
new file mode 100644
index 00000000..fb6a9d9a
--- /dev/null
+++ b/src/lib/__tests__/an-agent-keeps-running-in-a-hidden-window.test.ts
@@ -0,0 +1,21 @@
+import { describe, it, expect } from 'vitest'
+import { readFileSync } from 'node:fs'
+import { join } from 'node:path'
+
+// 14.11. CA bench: Kimi's run stood still for 13 minutes in CO10 with the page
+// suspended: no request, no socket, and even the 60 s stream idle watchdog did
+// not fire. WebKit fully suspends a web view that is not in a window unless
+// the window says otherwise, and LU never said. An agent works while you do
+// something else, so its window must not be suspended.
+const CONFIGS = ['tauri.conf.json', 'tauri.macos.conf.json', 'tauri.windows.conf.json', 'tauri.linux.conf.json']
+
+describe('the main window keeps running in the background', () => {
+ for (const name of CONFIGS) {
+ it(`${name} turns background throttling off`, () => {
+ const conf = JSON.parse(readFileSync(join(process.cwd(), 'src-tauri', name), 'utf8'))
+ const windows: Array<{ backgroundThrottling?: string }> = conf.app.windows
+ expect(windows.length).toBeGreaterThan(0)
+ for (const w of windows) expect(w.backgroundThrottling).toBe('disabled')
+ })
+ }
+})