jackwener/OpenCLI · error · EmptyResultError

No NotebookLM notebook is open in the adapter session. Run `

Error message

No NotebookLM notebook is open in the adapter session. Run `opencli notebooklm open <notebook>` first.

What it means

opencli notebooklm summary throws this EmptyResultError when the adapter session is not on a notebook page (state.kind !== 'notebook'). The notebook summary only exists within a notebook context, so the command fails fast before DOM/RPC reads.

Source

Thrown at clis/notebooklm/summary.js:20

import { EmptyResultError } from '@jackwener/opencli/errors';
import { NOTEBOOKLM_DOMAIN, NOTEBOOKLM_SITE } from './shared.js';
import { getNotebooklmPageState, getNotebooklmSummaryViaRpc, readNotebooklmSummaryFromPage, requireNotebooklmSession, } from './utils.js';
cli({
    site: NOTEBOOKLM_SITE,
    name: 'summary',
    access: 'read',
    description: 'Get the summary block from the currently opened NotebookLM notebook',
    domain: NOTEBOOKLM_DOMAIN,
    strategy: Strategy.COOKIE,
    browser: true,
    navigateBefore: false,
    args: [],
    columns: ['title', 'summary', 'source', 'url'],
    func: async (page) => {
        await requireNotebooklmSession(page);
        const state = await getNotebooklmPageState(page);
        if (state.kind !== 'notebook') {
            throw new EmptyResultError('opencli notebooklm summary', 'No NotebookLM notebook is open in the adapter session. Run `opencli notebooklm open <notebook>` first.');
        }
        const domSummary = await readNotebooklmSummaryFromPage(page);
        if (domSummary)
            return [domSummary];
        const rpcSummary = await getNotebooklmSummaryViaRpc(page).catch(() => null);
        if (rpcSummary)
            return [rpcSummary];
        throw new EmptyResultError('opencli notebooklm summary', 'NotebookLM summary was not found on the current page.');
    },
});

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Run `opencli notebooklm open <notebook>` before summary.
  2. Confirm with `opencli notebooklm current` that a notebook is active.
  3. Re-authenticate if bounced to home/login, then reopen the notebook.

Example fix

// before
opencli notebooklm summary   # no notebook open
// after
opencli notebooklm open "Research Notebook"
opencli notebooklm summary
Defensive patterns

Strategy: validation

Validate before calling

const current = await exec('opencli notebooklm current --json');
if (!current?.id) { await exec('opencli notebooklm open "My Notebook"'); }
// then run summary

Type guard

function isNotebookOpen(state) {
  return state?.kind === 'notebook' && typeof state?.notebookId === 'string' && state.notebookId.length > 0;
}

Try / catch

try {
  return await run('opencli notebooklm summary');
} catch (err) {
  if (/No NotebookLM notebook is open/.test(err.message)) {
    await run('opencli notebooklm open', [notebook]);
    return run('opencli notebooklm summary');
  }
  throw err;
}

Prevention

When it happens

Trigger: `opencli notebooklm summary` run while the page is the NotebookLM home screen, another site, or an unknown page — i.e. `opencli notebooklm open <notebook>` was never run in this session or the tab navigated away.

Common situations: Fresh adapter session; previous notebook closed; NotebookLM redirected to home after session expiry so the /notebook/<id> URL vanished; user opened the wrong URL type.

Related errors


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