Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
be2e3f6
Give the launch intro view and video unique project identifiers
Rouler4wd Sep 14, 2026
a33c0bf
Give every computer control run its own kill switch and screenshot
Rouler4wd Sep 14, 2026
c86df06
Queue approval cards and time out unattended approvals
Rouler4wd Sep 14, 2026
f5bb808
Serve browser commands from a lock guarded queue with long polling so…
Rouler4wd Sep 14, 2026
513f98e
Accept command results up to 16 MB and drain oversize bodies before a…
Rouler4wd Sep 14, 2026
f686923
Back off on accept failures, answer 503 when every handler is stalled…
Rouler4wd Sep 14, 2026
3768630
Bound accessibility lookups and match controls by every accessible name
Rouler4wd Sep 14, 2026
fb2f44a
Type and paste honestly and run AppleScript only on the main actor
Rouler4wd Sep 14, 2026
5a05d69
Keep several paired browser extensions with labels and Remove in Sett…
Rouler4wd Sep 14, 2026
7ecfcd8
Parse model JSON with one shared extractor and repair unreadable plan…
Rouler4wd Sep 14, 2026
8db5d51
Recover tool calls a local model writes inside prose or a code fence
Rouler4wd Sep 14, 2026
2452525
Detect stalled and timed out model requests and retry dropped connect…
Rouler4wd Sep 14, 2026
ee854db
Drop the dead model failure prefix check in the autonomous runner
Rouler4wd Sep 14, 2026
c625cd9
Show page context stale separately from worker liveness, remember the…
Rouler4wd Sep 14, 2026
f85e385
Run the skipped and new task pipeline test runners in CI
Rouler4wd Sep 14, 2026
0b1ea41
Give the launch intro view and video unique project identifiers
Rouler4wd Sep 14, 2026
84d3afc
Reinject content scripts into open tabs after install or update, let …
Rouler4wd Sep 14, 2026
38ad865
Put a timeout on every extension request, deliver commands through a …
Rouler4wd Sep 14, 2026
040100c
Retry failed result posts with backoff, replace results the bridge ca…
Rouler4wd Sep 14, 2026
ca8eb3b
Add a bridge soak test that runs 200 command round trips through the …
Rouler4wd Sep 14, 2026
972dbfc
Execute each browser command id at most once by keeping a session led…
Rouler4wd Sep 14, 2026
15e854b
Run browser commands concurrently across tabs with a serial queue per…
Rouler4wd Sep 14, 2026
ca4b14b
Park queued approvals behind direct cards instead of orphaning them
Rouler4wd Sep 14, 2026
f297989
Make navigate wait until the page finishes loading, bounded by a time…
Rouler4wd Sep 14, 2026
ebaba10
Wait until a background composer tab reports visible after Holmes act…
Rouler4wd Sep 14, 2026
c52a309
Bump the Holmes extension to version 2.3 for the bridge reliability c…
Rouler4wd Sep 14, 2026
5f534e8
Prefer the message body over a search field when typing with no field…
Rouler4wd Sep 14, 2026
52ea5e9
Run the send gate on the control a press actually matched
Rouler4wd Sep 14, 2026
b3f9558
Recover a tool call only when the message is the call
Rouler4wd Sep 14, 2026
fd0af2c
Never evict a live computer use run into a cancelled state
Rouler4wd Sep 14, 2026
f68d811
Synchronize the model transport failure hook across threads
Rouler4wd Sep 14, 2026
4950121
Report a timed out approval as a timeout instead of a decline
Rouler4wd Sep 14, 2026
5ee9f4c
Report unverified text entry as unverified in autonomous run summaries
Rouler4wd Sep 14, 2026
5bff0ba
Bound the whole accessibility walk by its time budget
Rouler4wd Sep 14, 2026
7ee3ee6
Replace the existing draft when a confirmed message card inserts its …
Rouler4wd Sep 14, 2026
78b2498
Tell the worker whether a long poll was actually held and back off wh…
Rouler4wd Sep 14, 2026
5245dbe
Claim a command id before reading the ledger so two copies of the sam…
Rouler4wd Sep 14, 2026
91b6f84
Target the remembered browser for a compose refresh only while it is …
Rouler4wd Sep 14, 2026
ba7d1f8
Keep only compact outcomes in the command ledger under a byte budget …
Rouler4wd Sep 14, 2026
fa504fc
Answer 503 immediately when every handler is busy instead of waiting …
Rouler4wd Sep 14, 2026
f5bfc74
Assign tab lanes strictly in arrival order so a command with an expli…
Rouler4wd Sep 14, 2026
90e3c86
Describe pairing accurately in Settings and show a newly paired brows…
Rouler4wd Sep 14, 2026
bc19a6d
Put a timeout on compose messages to the content script so a silent p…
Rouler4wd Sep 14, 2026
a189f02
Make navigate accept a complete status only after the new load was se…
Rouler4wd Sep 14, 2026
10fb753
Report pages that refuse script injection as restricted instead of mi…
Rouler4wd Sep 14, 2026
774e764
Merge the browser bridge reliability fixes into the task reliability …
Rouler4wd Sep 14, 2026
2de04d5
Wait for every long poll slot to be held before testing the cap so sl…
Rouler4wd Sep 15, 2026
07bfab0
Run blocking loopback socket calls on Dispatch threads so a narrow Sw…
Rouler4wd Sep 15, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,27 @@ jobs:
holmes/tests/run-work-activity-tests.sh
holmes/tests/run-extension-installer-tests.sh

- name: Test app launching, MCP transport and Ollama client settings
run: |
holmes/tests/run-app-launcher-tests.sh
holmes/tests/run-app-launch-intent-tests.sh
holmes/tests/run-mcp-http-transport-tests.sh
holmes/tests/run-ollama-capability-cache-tests.sh
holmes/tests/run-ollama-settings-tests.sh

- name: Test task pipeline reliability
run: |
holmes/tests/run-computer-use-run-tests.sh
holmes/tests/run-approval-queue-tests.sh
holmes/tests/run-ax-element-search-tests.sh
holmes/tests/run-text-entry-tests.sh
holmes/tests/run-model-json-tests.sh

- name: Test browser bridge reliability
run: |
holmes/tests/run-browser-bridge-extension-tests.sh
holmes/tests/run-browser-bridge-soak.sh

- name: Upload build log
if: always()
uses: actions/upload-artifact@v4
Expand Down
135 changes: 131 additions & 4 deletions holmes/holmes-extension/automation.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,104 @@ self.HolmesAutomation = (function () {

var PAGE_ACTIONS = { click: 1, fillField: 1, readSelection: 1, extract: 1, scrollTo: 1, waitForSelector: 1 };

// Tunables (tests shorten them through self.__holmesBridgeConfig). Local to this
// closure so they never collide with the worker's own names.
var TUNING = (typeof self !== "undefined" && self.__holmesBridgeConfig) || {};
// A PNG of a Retina viewport is easily 5 to 15 MB of base64; results travel
// over the loopback bridge, so screenshots are JPEG and kept under this size.
var MAX_SCREENSHOT_CHARS = Number(TUNING.maxScreenshotChars) || 4 * 1024 * 1024;
var SCREENSHOT_MAX_WIDTH = 1600;
// How long navigate waits for the page to finish loading. Below the app's 20s
// result timeout so a slow page reports loaded:false instead of timing out.
var NAVIGATE_TIMEOUT_MS = Number(TUNING.navigateTimeoutMs) || 15000;

// Resolves when the tab reports status "complete" after arm() (so a completion
// from the page being replaced is ignored), when it closes, or at the timeout.
// Listeners are attached before navigation starts so a fast load is never missed.
function waitForTabComplete(tabId, timeoutMs, targetUrl) {
var started = Date.now(), armed = false, done = false, timer = null, finish;
// Chrome resolves tabs.update before the new load begins, while the tab still
// reports the PREVIOUS page as complete. So "complete" only counts once this
// navigation was seen loading, or when the tab is complete at the target URL
// with nothing pending (which also covers same document navigations).
var sawLoading = false;
function sameUrl(a, b) {
try { return new URL(a).href === new URL(b).href; } catch (e) { return a === b; }
}
function landedOn(tab) {
return !!tab && tab.status === "complete" && !tab.pendingUrl && !!targetUrl && sameUrl(tab.url, targetUrl);
}
var promise = new Promise(function (resolve) { finish = resolve; });
function settle(result) {
if (done) return;
done = true;
if (timer) clearTimeout(timer);
try { chrome.tabs.onUpdated.removeListener(onUpdated); } catch (_) { /* ignore */ }
try { chrome.tabs.onRemoved.removeListener(onRemoved); } catch (_) { /* ignore */ }
result.waitedMs = Date.now() - started;
finish(result);
}
function onUpdated(id, info, tab) {
if (id !== tabId || !info) return;
if (info.status === "loading") { sawLoading = true; return; }
if (!armed) return;
if ((info.status === "complete" && sawLoading) || landedOn(tab)) settle({ complete: true });
}
function onRemoved(id) {
if (id === tabId) settle({ complete: false, closed: true });
}
chrome.tabs.onUpdated.addListener(onUpdated);
chrome.tabs.onRemoved.addListener(onRemoved);
timer = setTimeout(function () { settle({ complete: false, timedOut: true }); }, timeoutMs);
return {
promise: promise,
arm: async function () {
armed = true;
try {
var tab = await chrome.tabs.get(tabId);
if (tab && tab.status === "complete" && (sawLoading || landedOn(tab))) settle({ complete: true });
} catch (e) {
settle({ complete: false, closed: true });
}
},
cancel: function () { settle({ complete: false, cancelled: true }); }
};
}

function toBase64(buffer) {
var bytes = new Uint8Array(buffer), binary = "";
for (var i = 0; i < bytes.length; i += 0x8000) {
binary += String.fromCharCode.apply(null, bytes.subarray(i, i + 0x8000));
}
return btoa(binary);
}

// Downscales a captured image to at most SCREENSHOT_MAX_WIDTH wide and re-encodes
// it as JPEG until it fits. Null when the worker has no OffscreenCanvas.
async function downscaleDataUrl(dataUrl, maxChars) {
try {
if (typeof OffscreenCanvas !== "function" || typeof createImageBitmap !== "function") return null;
var blob = await (await fetch(dataUrl)).blob();
var bitmap = await createImageBitmap(blob);
var scale = Math.min(1, SCREENSHOT_MAX_WIDTH / bitmap.width);
var width = Math.max(1, Math.round(bitmap.width * scale));
var height = Math.max(1, Math.round(bitmap.height * scale));
var canvas = new OffscreenCanvas(width, height);
canvas.getContext("2d").drawImage(bitmap, 0, 0, width, height);
if (bitmap.close) bitmap.close();
var quality = 0.7, out = "";
for (;;) {
var jpeg = await canvas.convertToBlob({ type: "image/jpeg", quality: quality });
out = "data:image/jpeg;base64," + toBase64(await jpeg.arrayBuffer());
if (out.length <= maxChars || quality <= 0.3) break;
quality -= 0.2;
}
return { dataUrl: out, width: width, height: height };
} catch (e) {
return null;
}
}

async function resolveTabId(params) {
if (params && typeof params.tabId === "number" && params.tabId >= 0) return params.tabId;
try {
Expand Down Expand Up @@ -379,8 +477,25 @@ self.HolmesAutomation = (function () {
if (!params.url) return { ok: false, error: "navigate requires a url" };
var navTabId = await resolveTabId(params);
if (navTabId < 0) return { ok: false, error: "no target tab" };
var navTab = await chrome.tabs.update(navTabId, { url: String(params.url) });
return { ok: true, tabId: navTab.id, url: String(params.url) };
// Resolving right after tabs.update let the next command (click, extract)
// run against the page being replaced. Wait for the load, bounded.
var loading = waitForTabComplete(navTabId, NAVIGATE_TIMEOUT_MS, String(params.url));
var navTab;
try {
navTab = await chrome.tabs.update(navTabId, { url: String(params.url) });
} catch (e) {
loading.cancel();
throw e;
}
await loading.arm();
var loaded = await loading.promise;
if (loaded.closed) {
return { ok: false, tabId: navTabId, url: String(params.url), error: "the tab was closed while navigating" };
}
var landed = null;
try { landed = await chrome.tabs.get(navTabId); } catch (_) { /* closed after load */ }
return { ok: true, tabId: navTab.id, url: (landed && landed.url) || String(params.url),
title: landed ? landed.title : undefined, loaded: !!loaded.complete, waitedMs: loaded.waitedMs };
}

case "openTab": {
Expand All @@ -407,8 +522,20 @@ self.HolmesAutomation = (function () {
var windowId = shotTab ? shotTab.windowId : undefined;
// captureVisibleTab grabs the ACTIVE tab of the window; note that if the
// requested tab isn't active this returns whatever is frontmost there.
var dataUrl = await chrome.tabs.captureVisibleTab(windowId, { format: "png" });
return { ok: true, tabId: shotTab ? shotTab.id : -1, format: "png", dataUrl: dataUrl, bytes: dataUrl ? dataUrl.length : 0 };
var quality = 70;
var dataUrl = await chrome.tabs.captureVisibleTab(windowId, { format: "jpeg", quality: quality });
var downscaled = false;
if (dataUrl && dataUrl.length > MAX_SCREENSHOT_CHARS) {
var scaled = await downscaleDataUrl(dataUrl, MAX_SCREENSHOT_CHARS);
if (scaled && scaled.dataUrl.length < dataUrl.length) { dataUrl = scaled.dataUrl; downscaled = true; }
}
// No canvas in this worker: fall back to recapturing at lower quality.
while (!downscaled && dataUrl && dataUrl.length > MAX_SCREENSHOT_CHARS && quality > 30) {
quality -= 20;
dataUrl = await chrome.tabs.captureVisibleTab(windowId, { format: "jpeg", quality: quality });
}
return { ok: true, tabId: shotTab ? shotTab.id : -1, format: "jpeg", quality: quality, downscaled: downscaled,
dataUrl: dataUrl, bytes: dataUrl ? dataUrl.length : 0 };
}

default: {
Expand Down
Loading
Loading