← Commit history

v0.16.68 (insiders): Extension refusals read as failures (nb-bridge#57): when the extension answers ok:false (no such element, option not found, a wait that timed out, a verb an older extension lacks), the reply now says success:false at the top level, where it used to say success:true with the refusal only inside output; every field still comes back, at the top level and in output.

Colby Knox ·16dec38ce8 ·5d ago ·parent 585a997
6 files changed +17−8
bin/nb-dashboard+1−1
@@ -20,7 +20,7 @@ const { execFile, spawn } = require('child_process'); const fs = require('fs'); const crypto = require('crypto'); -const VERSION = '0.16.67';           // keep in lockstep with package.json (pkg version)+const VERSION = '0.16.68';           // keep in lockstep with package.json (pkg version) // SEND TO AI IS UN-PARKED (John: "yeah, we are re-enabling the send to ai. it seems to be good now"). // The ah build thread certified the crash family dead on the gate-fixed build and the delivery leg is // proven end to end. The park const is DELETED rather than flipped, so no dead branch can resurrect it.
bridge/BRIDGE_VERSION+1−1
@@ -1 +1 @@-0.16.67\ No newline at end of file+0.16.68\ No newline at end of file
bridge/bridge.json+1−1
@@ -2,7 +2,7 @@   "manifest_version": 1,   "name": "native-browser",   "displayName": "Adom Native Browser",-  "version": "0.16.67",+  "version": "0.16.68",   "expectedExtensionVersion": "0.2.23",   "description": "Drives the user's REAL signed-in Chrome/Edge, in two layers. Layer 1 (nb) needs NOTHING installed and works on any machine: nbrowser_open_os_window (open a URL in the user's real profile, background+flashing, the OAuth/consent path), nbrowser_os_windows, nbrowser_profiles, nbrowser_wake_profile, nbrowser_force_close. Layer 2 (nbe, the Adom Native Browser Extension) unlocks the rest: CDP driving (navigate/click/read/screenshot) inside their logged-in profile. The bridge binds an ephemeral loopback port and the native-messaging host pumps stdio <-> bridge.",   "homepage": "https://wiki.adom.inc/adom/nb-bridge",
bridge/package.json+1−1
@@ -1,6 +1,6 @@ {   "name": "adom-native-browser-bridge",-  "version": "0.16.67",+  "version": "0.16.68",   "private": true,   "description": "Native-browser bridge for Bridge (ab): layer 1 (nb) plus layer 2 via nbe, the Adom Native Browser Extension (Chrome + Edge).",   "main": "server.js",
bridge/server.js+12−3
@@ -3823,15 +3823,19 @@ async function onHostFrameInner(frame) {     const p = pending.get(frame.id);     clearTimeout(p.timer);     pending.delete(frame.id);-    if (p.startedAt) activityStop(frame.id, p.verb, true, Date.now() - p.startedAt);+    if (p.startedAt) activityStop(frame.id, p.verb, !!frame.ok && !(frame.payload && frame.payload.ok === false), Date.now() - p.startedAt);     if (frame.ok) {       let payload = frame.payload || {};       // Any exception in the decoration below used to reject this async handler silently and the caller       // timed out even though the extension had answered. Decoration is best-effort; the reply is not.       try { await decorateReply(p, frame, payload, (v) => { payload = v; }); }       catch (e) { payload._postError = String((e && e.message) || e); }-      // A refused upload must read as a failure at the top level, where callers look (pup-bridge#145).-      if (p.verb === 'nbrowser_set_file_input' && payload.ok === false && payload.errorCode) { p.resolve({ success: false, ...payload }); return; }+      // nb-bridge#57: when the extension answers ok:false (no such element, option not found, a wait that timed+      // out, a verb an older extension lacks) the reply must read as a FAILURE at the top level, where every+      // caller looks. It used to go out as success:true with the refusal only inside `output`, so an AI reading+      // status/success believed it worked. Every field still comes back, at the top level and in `output`, so a+      // caller that needs the data on a non-success answer (an override ticket, the login step) still has it.+      if (payload && payload.ok === false) { p.resolve(refusalEnv(payload)); return; }       resolve_ok(p.resolve, payload);       return;     }@@ -3852,6 +3856,11 @@ function deliveryEnv(payload, from) {   return env; } function resolve_ok(resolve, payload) { resolve(deliveryEnv(payload)); }+function refusalEnv(payload) {+  const env = { ...payload, success: false, output: JSON.stringify(payload) };+  if (!env.error) env.error = payload.timedOut ? 'timed out' : 'the extension refused';+  return env;+}  // Loopback bind host. ab (v1.9.63+) passes ADOM_BIND_HOST (always 127.0.0.1) to every bridge it // spawns; bind to it so we never default to 0.0.0.0 and pop a Windows Firewall "allow access?"
package.json+1−1
@@ -1,6 +1,6 @@ {   "slug": "nb-bridge",-  "version": "0.16.67",+  "version": "0.16.68",   "type": "app",   "title": "NB - Native Browser Bridge",   "description": "This package installs the SKILLS into your container so your AI knows how to drive your real signed-in Chrome and Edge; Bridge loads the bridge runtime itself from the release zip.",