jackwener/OpenCLI · error · CommandExecutionError

Unexpected NotebookLM probe: ${JSON.stringify(probe)}

Error message

Unexpected NotebookLM probe: ${JSON.stringify(probe)}

What it means

The post-login page probe returned an unrecognized shape — not authenticated (kind:'auth') and not a successful identity ({ ok: true, name, authuser }). The library throws CommandExecutionError with the JSON-serialized probe to aid debugging, since it cannot determine login state.

Source

Thrown at clis/notebooklm/auth.js:40

      }
      const acctEl = document.querySelector('a[aria-label^="Google Account:"], a[aria-label*="Google 账号:"]');
      if (!acctEl) {
        return { kind: 'auth', detail: 'NotebookLM missing Google Account button' };
      }
      const label = acctEl.getAttribute('aria-label') || '';
      const nameMatch = label.match(/Google Account:\\s*([^\\n\\(]+?)(?:\\s*\\n|\\s*\\()/i) ||
                        label.match(/Google 账号:\\s*([^\\n\\(]+?)(?:\\s*\\n|\\s*\\()/i);
      const name = nameMatch ? nameMatch[1].trim() : '';
      const authuserMatch = location.href.match(/[?&]authuser=(\\d+)/);
      const authuser = authuserMatch ? Number(authuserMatch[1]) : 0;
      if (!name) {
        return { kind: 'auth', detail: 'NotebookLM Google Account aria-label found but name unparseable' };
      }
      return { ok: true, name, authuser };
    })()
  `));
  if (probe?.kind === 'auth') throw new AuthRequiredError(NOTEBOOKLM_DOMAIN, probe.detail);
  if (!probe?.ok) throw new CommandExecutionError(`Unexpected NotebookLM probe: ${JSON.stringify(probe)}`);
  return { name: probe.name, authuser: probe.authuser };
}

registerSiteAuthCommands({
  site: 'notebooklm',
  domain: 'google.com',
  loginUrl: `https://accounts.google.com/ServiceLogin?service=lso&continue=${encodeURIComponent(NOTEBOOKLM_HOME_URL)}`,
  columns: ['name', 'authuser'],
  quickCheck: hasNotebookLmSsoCookies,
  verify: verifyNotebookLmIdentity,
  poll: async (page) => {
    if (!await hasNotebookLmSsoCookies(page)) {
      throw new AuthRequiredError(NOTEBOOKLM_DOMAIN, 'Waiting for Google SSO cookies (SID + SAPISID)');
    }
    return verifyNotebookLmIdentity(page);
  },
});

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Log the full probe JSON from the error message to see what shape came back.
  2. Manually open notebooklm.google.com in the profile and complete any consent/captcha interstitials.
  3. Update the library if NotebookLM's DOM changed (probe selectors no longer match).
  4. Retry after a clean login; transient load failures can produce empty probe results.
Defensive patterns

Strategy: try-catch

Try / catch

try {
  await cmd();
} catch (e) {
  if (String(e.message).startsWith('Unexpected NotebookLM probe:')) {
    // inspect probe JSON in the message; clear interstitials / update lib
    const probe = JSON.parse(e.message.slice('Unexpected NotebookLM probe: '.length));
    console.error('Probe shape:', probe);
  }
  throw e;
}

Prevention

When it happens

Trigger: The in-page probe script returns anything other than {kind:'auth'} or {ok:true,...}: e.g. null/undefined evaluate result, an exception payload, or a page where neither the auth chip nor the account label is found.

Common situations: NotebookLM DOM changed so probe selectors match nothing; page failed to load (error page, captcha, consent screen); page.evaluate returned undefined due to content-script/CSP changes.

Related errors


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/bff8e0ee1e021160. Report an issue: GitHub.