A desktop coding agent with free access to frontier models.
TypeScript
fix: observe settled windows
ogsamratd8ceca8af5aa
diff --git a/apps/server/src/computer-use/shared/PARITY.sha256 b/apps/server/src/computer-use/shared/PARITY.sha256index a56d8d77..57758792 100644--- a/apps/server/src/computer-use/shared/PARITY.sha256+++ b/apps/server/src/computer-use/shared/PARITY.sha256@@ -9,5 +9,5 @@ a96246342720364eb3e5843ba70fbbf640365f94597fc4dbb6a7be7d95254ec4 image.mjs98ffcc70c69299917c9804c32b786e58c1677edf7ea0732a3fe12b9f6781ba29 media.mjsc12540410a558f4b48960c75b7a09e0660d6de679a6e49e2542427530fd9a3d4 media.d.mts02be6c62de13f3c8a55a0167c751742086c16bfadb201e9ce8e7f1b955d2376d native-worker.mjs-8d53edb30e8d8f582bb02cad06731266f7362dab3d98b08ed8e5d3b308ae7208 portable-host.mjs+0421dd5f0e6812df5693aadcd99f2cdf871a0c78ce93113c98d53b526d55e1b0 portable-host.mjs3adf92d8ab9fe7a1a8b595c090f6ba4f99ed10d5146c318cfbdf7b674aec9657 portable-host.d.mtsdiff --git a/apps/server/src/computer-use/shared/portable-host.mjs b/apps/server/src/computer-use/shared/portable-host.mjsindex 6b386430..5b819931 100644--- a/apps/server/src/computer-use/shared/portable-host.mjs+++ b/apps/server/src/computer-use/shared/portable-host.mjs@@ -202,12 +202,12 @@ export async function createPortableHost({ native, spool = null, settings, conteconst l = limits();let frame = await native.call("capture", { window: w }, 15_000);let grid = luminanceGrid(fitLongSide(frame, l.model_long_side));- // Wait (briefly) for the window to settle; small changes (caret, spinner) are tolerated.- for (let attempt = 0; attempt < 3; attempt += 1) {- await sleep(60);+ // Wait (briefly) for the window to settle: until two frames match (a blinking caret may never let it; then the last frame).+ for (let attempt = 0; attempt < 4; attempt += 1) {+ await sleep(attempt === 0 ? 60 : 90);const next = await native.call("capture", { window: w }, 15_000);const nextGrid = luminanceGrid(fitLongSide(next, l.model_long_side));- const same = !compareGrids(grid, nextGrid).stale;+ const same = compareGrids(grid, nextGrid).changed === 0;frame = next; grid = nextGrid;if (same) break;}