app
Pup - the AI's own browser
Public Made by Adomby adom
pup gives your AI a real browser on your desktop that it drives completely, in the background, signed in as you: windows that never jump in front of your work, one shared profile that learns your logins, and every window labeled on the taskbar with its AI thread's name.
← Commit history
EMERGENCY: revert+harden the v1.9.181 tab reconciler that destroyed live windows (John's smu-deck-pup2 and wiki-review were stripped to 0 tabs mid-use and taken down). Root cause: liveness judged from browser.targets() via puppeteer-internal target-id fields whose id set did not match page.target()'s, so every live tab looked absent and was dropped. Now: a tab is dropped only on DIRECT evidence (isClosed, or a probe failing with the crashed/detached-frame signature; timeout=busy=keep), never on target-set inference; a new safety rail refuses any reconcile that would empty a session outright (wholesale-death is more likely a probe failure); patrol slowed 45s to 5min (rescans still reconcile inline).
4 files changed
+35−20
adom-bridge-puppeteer-manifest.json+4−4@@ -1,10 +1,10 @@ { "manifest_version": 1, "name": "puppeteer",- "version": "1.9.181",- "url": "https://wiki.adom.inc/download/adom/adom-desktop-puppeteer-bridge/1.9.181/adom-bridge-puppeteer-v1.9.181.zip",- "sha256": "4a073f79a8eb5f633ce637b5aa928a83c46a026fc4e637f826dc4689a5c18117",- "size": 418796,+ "version": "1.9.182",+ "url": "https://wiki.adom.inc/download/adom/adom-desktop-puppeteer-bridge/1.9.182/adom-bridge-puppeteer-v1.9.182.zip",+ "sha256": "a005455f0dcaf4003aa975b8a7cba5dbfcdfbe943e4175dede56808da8cf671c",+ "size": 419485, "verbPrefixes": [ "browser_", "desktop_recorder_",
src/BRIDGE_VERSION+1−1@@ -1 +1 @@-1.9.181+1.9.182
src/bridge.json+1−1@@ -2,7 +2,7 @@ "manifest_version": 1, "name": "puppeteer", "displayName": "Puppeteer (Chrome for Testing + Native)",- "version": "1.9.181",+ "version": "1.9.182", "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/server.js+29−14@@ -872,30 +872,42 @@ function _pageTargetId(page) { // merely-slow tab is never wrongly dropped. async function reconcileSessionTabs(session, sessionId) { if (!session || !Array.isArray(session.tabs) || session.tabs.length === 0) return 0;- // v1.9.181: liveness via the BROWSER-process target list, not a per-tab page.evaluate. The eval- // probe woke every throttled renderer on every sweep (the issue-#14 battery sin, re-committed) and- // added constant CDP load. browser.targets() answers from the browser process alone: a tab whose- // targetId is absent is dead; two tabs sharing one targetId are the reconnect-duplicate case.- let liveTargets = null;- try {- const be = browsers.get(session.profileName);- if (be && be.browser && be.browser.isConnected()) {- liveTargets = new Set(be.browser.targets().filter(t => t.type() === 'page').map(t => t._targetId || (t._targetInfo && t._targetInfo.targetId)).filter(Boolean));- }- } catch (e) {}- if (!liveTargets) return 0; // no browser handle → can't judge; never drop tabs blind+ // v1.9.182 — EMERGENCY FIX for the v1.9.181 reconciler, which DESTROYED live windows (John:+ // "why did my pup windows just crash?" — smu-deck-pup2 and wiki-review were stripped to 0 tabs+ // while he was USING them). The 1.9.181 version judged liveness from browser.targets() via+ // puppeteer-internal target-id fields; the id sets from browser.targets() and page.target() did+ // not match, so EVERY live tab looked "absent" and was dropped. Lesson enforced here: the+ // reconciler must be able to prove a tab dead with DIRECT evidence before dropping it.+ // - isClosed() → dead (puppeteer's own state, no internals).+ // - Otherwise a tab is dropped ONLY if a 1.5s probe fails with a crashed/detached-frame error+ // (the phantom signature). A timeout means busy → KEEP. No target-set inference, ever.+ // - Duplicate detection (same target id twice) keeps the FIRST binding and needs no liveness+ // judgement; unresolvable ids are never treated as duplicates.+ // Cost honesty: this restores a per-tab probe, but ONLY for tabs not already provably closed, and+ // the probe reuses the page's existing session (no renderer paint wake for a throttled page+ // answering a trivial eval). Correctness beats the load micro-win — proven by today's failure. const kept = []; const seenTargets = new Set(); let dropped = 0; for (const t of session.tabs) { let dead = false; try { if (!t.page || t.page.isClosed()) dead = true;+ else {+ try { await withTimeout(t.page.evaluate('1'), 1500, 'tab-reconcile'); }+ catch (e) { if (_isCrashedFrameError(e)) dead = true; /* timeout = busy → keep */ }+ } } catch (e) { dead = true; } const tid = dead ? null : _pageTargetId(t.page);- if (!dead && tid && !liveTargets.has(tid)) dead = true; if (dead || (tid && seenTargets.has(tid))) { dropped++; continue; } if (tid) seenTargets.add(tid); kept.push(t); }+ // Safety rail: NEVER let a reconcile empty a session that had live-looking tabs going in. If every+ // tab judged dead, distrust the judgement (a systemic probe failure looks exactly like this) —+ // keep the tabs and let real evidence (isClosed, disconnects) catch genuinely dead ones later.+ if (kept.length === 0 && session.tabs.length > 0 && !session._lostBrowser) {+ console.log(`[tabs] session "${sessionId}" reconcile judged ALL ${session.tabs.length} tab(s) dead — refusing the wholesale drop (probe failure is more likely than every tab dying at once)`);+ return 0;+ } if (dropped > 0) { session.tabs = kept; if (session.activeTabId && !kept.find(t => t.tabId === session.activeTabId)) {@@ -10383,8 +10395,11 @@ server.listen(PORT, BIND_HOST, async () => { // badge reflects the REAL live tabs (rapid reconnects had inflated 1-tab windows to "4") and the // favicon overlay reads from a LIVE active tab instead of a detached phantom. Runs on a gentle // cadence; only sessions whose tab list actually changed re-stamp their overlay.+ // v1.9.182: boot pass + a SLOW patrol (5 min, was 45s). The dup/phantom state only arises from+ // reconnects, and every rescan already reconciles inline — the patrol is just a backstop, and a+ // hot one multiplies any probe-judgement bug across every window (today's lesson). setTimeout(() => { for (const [sid, s] of [...sessions]) reconcileSessionTabs(s, sid).catch(() => {}); }, 8000);- setInterval(() => { for (const [sid, s] of [...sessions]) reconcileSessionTabs(s, sid).catch(() => {}); }, 45000);+ setInterval(() => { for (const [sid, s] of [...sessions]) reconcileSessionTabs(s, sid).catch(() => {}); }, 300000); // v1.9.171 — CRASH SELF-HEAL. The shared Chrome dies two ways on heavy/hostile pages (measured // repeatedly on the Autodesk sign-in flow), and pup must recover from BOTH without a human: //