← Commit history
battery: the default target must never be pup's own browser
1 file changed
+2−1
tools/verb-battery.mjs+2−1@@ -69,7 +69,8 @@ const T = { readiness: () => { const r = call('nbrowser_readiness'); ctx.ready = r.ready; return A(typeof r.ready === 'boolean' && r.claudeExtension !== undefined, `ready:${r.ready} state:${r.state}`, JSON.stringify(r).slice(0, 160)); }, ping: () => { const r = call('nbrowser_ping'); return A(r.ok === true && r.pong === true, 'pong', JSON.stringify(r).slice(0, 120)); }, whoami: () => { const r = call('nbrowser_whoami'); return A(r.ok !== false, `keys:${Object.keys(r).slice(0, 5)}`, JSON.stringify(r).slice(0, 120)); },- profiles: () => { const r = call('nbrowser_profiles'); const ps = r.profiles || []; ctx.profileCount = ps.length; return A(ps.length > 0, `${ps.length} profiles`, JSON.stringify(r).slice(0, 140)); },+ // The DEFAULT target must never be pup's own browser (2026-09-21: an unnamed open landed in a pup window).+ profiles: () => { const r = call('nbrowser_profiles'); const ps = r.profiles || []; ctx.profileCount = ps.length; const def = ps.find((p) => p.profile === r.active); const pups = ps.filter((p) => p.origin === 'pup').length; return A(ps.length > 0 && !(def && def.origin === 'pup'), `${ps.length} profiles, default ${r.active} (origin ${def ? def.origin : 'none'}), ${pups} pup connection(s) set aside`, `default is pup's browser or no profiles: ${JSON.stringify(r).slice(0, 160)}`); }, resolve_profiles: () => { const r = call('nbrowser_resolve_profiles'); return A(r.ok !== false, 'resolved', JSON.stringify(r).slice(0, 120)); }, // An Edge-only box is a PASS: nb drives whatever native browser is there (nb-bridge#46). chrome_status: () => { const r = call('nbrowser_chrome_status'); const ok = r.installed === true || (r.nativeBrowserPresent === true && r.chromeNeeded === false && r.edgeInstalled === true); return A(ok, r.installed ? `chrome installed, phase:${r.phase}` : 'edge-only box: chromeNeeded:false, Chrome reported optional', JSON.stringify(r).slice(0, 140)); },