← Commit history

CRITICAL FIX: pup sent NO caller identity on its own AD callbacks, and AD (>=1.9.183) refuses any command without one — so EVERY desktop_* call from the bridge was rejected. Blast radius was total and user-visible: desktop_set_window_identity refused means no window got branded (all five example windows fell back to Chrome's icon, including OTHER threads' windows), and the on-screen park being refused left windows stranded at -32768,-32768 so clicking their taskbar button showed nothing. Root cause was my own reasoning error in 1.9.104: I forwarded the originating thread for session-scoped calls but deliberately sent nothing when pup acted on its own behalf, thinking 'no caller' was the honest answer. AD's answer to no caller is a refusal, and the contract explicitly says to send your OWN caller block for your own work. adCommand now ALWAYS identifies a caller (the forwarded thread when there is one, else 'pup bridge (self)'), and sends it as BOTH a header and an args caller block because AD's precedence puts args above headers and a header-only path must not be able to silently un-brand every window again.

John Lauer ·a045b8da6c ·3mo ago ·parent 36c8253
4 files changed +26−9
adom-bridge-puppeteer-manifest.json+4−4
@@ -1,10 +1,10 @@ {   "manifest_version": 1,   "name": "puppeteer",-  "version": "1.9.113",-  "url": "https://wiki.adom.inc/download/adom/adom-desktop-puppeteer-bridge/1.9.113/adom-bridge-puppeteer-v1.9.113.zip",-  "sha256": "3242731de3ab96b439a133f660baf5ea3425915de220133a9a22e84d295864e4",-  "size": 381983,+  "version": "1.9.114",+  "url": "https://wiki.adom.inc/download/adom/adom-desktop-puppeteer-bridge/1.9.114/adom-bridge-puppeteer-v1.9.114.zip",+  "sha256": "67de6002c4f84d33aba95e1e564f9d29a5c00e00b59d34d48fffe5211e72998f",+  "size": 382598,   "verbPrefixes": [     "browser_",     "desktop_recorder_",
src/BRIDGE_VERSION+1−1
@@ -1 +1 @@-1.9.113+1.9.114
src/bridge.json+1−1
@@ -2,7 +2,7 @@   "manifest_version": 1,   "name": "puppeteer",   "displayName": "Puppeteer (Chrome for Testing + Native)",-  "version": "1.9.113",+  "version": "1.9.114",   "description": "Drives a browser ALREADY on the machine \u2014 installed Chrome, else Microsoft Edge (every Windows PC ships with Edge) \u2014 launched with a FRESH isolated profile, so the common case has NO ~150 MB Chrome-for-Testing download and it never touches the user's real tabs/logins. Binds its local server to LOOPBACK (127.0.0.1) only, so no Windows Firewall 'allow Node through the firewall' prompt ever pops. Chrome for Testing is fetched only as a LAST RESORT if the machine has no Chromium browser at all. SPAWN-VERIFIED fallback: pup tries each detected browser (Chrome \u2192 Edge \u2192 CfT) and actually launches it, falling through to the next if one won't start (and handling browsers like Edge that relaunch onto another PID), so a corrupt/partial install never hard-fails an open. The browser that launches is cached as the default (persisted across restarts) so it isn't re-probed each time. On spawn the bridge SELF-WARMS: detects browsers + disk, and only if the box has no Chrome/Edge and no cached CfT does it background-fetch CfT so the first open is instant. browser_use pins a specific browser (chrome | edge | cft | auto); {browser:'chrome',install:true} downloads & installs REAL Google Chrome (user-scoped, no admin) on an Edge-only box. browser_readiness (READ-ONLY) reports which browser will be used + the full candidate list + the default + free disk. Every failure returns a specific errorCode + _hint (chrome_install_no_disk, chrome_download_network, chrome_install_permission, chrome_stable_not_detected, \u2026). Launches with FULL browser permissions by default for full debug (strictPermissions:true opts out). Headful automation: open/close windows+tabs, navigate, screenshot, eval JS, record. pup is a GENERIC, non-profile browser only \u2014 every session is a fresh isolated Chrome/Edge process, never the user's real signed-in browser; profile defaults to sessionId. To drive the user's REAL Chrome/Edge (their profile, cookies, SSO), use the Adom browser EXTENSION's nbrowser_* verbs \u2014 a separate bridge, not pup's job. macOS (v1.9.74+): full parity with mac-native mechanics \u2014 background-by-default is the app-level hide (windows stay drivable/screenshottable while hidden), raise/lower map to unhide+activate/hide, browser_alert_window posts a native toast whose click focuses the window, browser_use {browser:'chrome',install:true} installs Chrome from the official dmg, and taskbar identity/badging remains Windows-only.",   "homepage": "https://wiki.adom.inc/adom/adom-desktop",   "author": "Adom Inc.",
src/chrome.js+20−3
@@ -635,17 +635,34 @@ function adCommand(command, args, opts = {}) {       const http = require('http');       const payload = { command, args: args || {} };       if (target) payload.target = target;-      const body = JSON.stringify(payload);       const u = new URL(base + '/command');-      const headers = { 'Content-Type': 'application/json', 'Content-Length': Buffer.byteLength(body) };+      const headers = { 'Content-Type': 'application/json' };       const tok = process.env.ADOM_BRIDGE_TOKEN;       if (tok && !noToken) headers['X-Adom-Bridge-Token'] = tok;       headers['X-Adom-Caller-Delegate'] = AD_DELEGATE_NAME;   // name ourselves: "<thread> (via pup)"       try {-        if (caller && caller.thread)    headers['X-Adom-Caller-Thread']    = String(caller.thread).slice(0, 120);+        // v1.9.114 — CRITICAL: AD (>=1.9.183) REFUSES any command with no caller identity, including a+        // bridge's own loopback callbacks. I previously sent NOTHING when pup was acting on its own+        // behalf, reasoning that "no caller" was the honest answer. AD's answer is a refusal, and the+        // blast radius was total: EVERY desktop_set_window_identity was rejected+        // ("needs to know WHO is asking"), so no pup window got branded and all of them fell back to+        // Chrome's icon — including OTHER threads' windows. The contract's own words are "send your own+        // caller block when the work is genuinely your own", so that is what we do now: forward the+        // originating thread when we have one, else name PUP as the caller. Never send nothing.+        const thread = (caller && caller.thread) ? String(caller.thread).slice(0, 120) : 'pup bridge (self)';+        headers['X-Adom-Caller-Thread'] = thread;         if (caller && caller.container) headers['X-Adom-Caller-Container'] = String(caller.container).slice(0, 120);         if (caller && caller.reason)    headers['X-Adom-Caller-Reason']    = String(caller.reason).slice(0, 300);+        // Belt and braces: AD's documented precedence puts an explicit args `caller` ABOVE headers, and+        // a header-only path regressed once before. Send both so a future header change cannot silently+        // un-brand every window again.+        if (payload.args && typeof payload.args === 'object' && !Array.isArray(payload.args) && !payload.args.caller) {+          payload.args.caller = { aiThread: thread };+          if (caller && caller.container) payload.args.caller.containerName = String(caller.container).slice(0, 120);+        }       } catch (e) {}+      const body = JSON.stringify(payload);+      headers['Content-Length'] = Buffer.byteLength(body);       const req = http.request(         { hostname: u.hostname, port: u.port, path: u.pathname, method: 'POST', headers },         (resp) => {