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

The source-fulltext command first requires an active adapter session and then checks getNotebooklmPageState: if the current page is not a notebook (state.kind !== 'notebook'), there is no notebook context to read sources from. It throws an EmptyResultError telling the user to open a notebook with `opencli notebooklm open <notebook>` first.

Source

Thrown at clis/notebooklm/source-fulltext.js:27

    description: 'Get the extracted fulltext for one source in the currently opened NotebookLM notebook',
    domain: NOTEBOOKLM_DOMAIN,
    strategy: Strategy.COOKIE,
    browser: true,
    navigateBefore: false,
    args: [
        {
            name: 'source',
            positional: true,
            required: true,
            help: 'Source id or title from the current notebook',
        },
    ],
    columns: ['title', 'kind', 'char_count', 'url', 'source'],
    func: async (page, kwargs) => {
        await requireNotebooklmSession(page);
        const state = await getNotebooklmPageState(page);
        if (state.kind !== 'notebook') {
            throw new EmptyResultError('opencli notebooklm source-fulltext', 'No NotebookLM notebook is open in the adapter session. Run `opencli notebooklm open <notebook>` first.');
        }
        const rpcRows = await listNotebooklmSourcesViaRpc(page).catch(() => []);
        const rows = rpcRows.length > 0 ? rpcRows : await listNotebooklmSourcesFromPage(page);
        if (rows.length === 0) {
            throw new EmptyResultError('opencli notebooklm source-fulltext', 'No NotebookLM sources were found on the current page.');
        }
        const query = typeof kwargs.source === 'string' ? kwargs.source : String(kwargs.source ?? '');
        const matched = findNotebooklmSourceRow(rows, query);
        if (!matched) {
            throw new EmptyResultError('opencli notebooklm source-fulltext', `Source "${query}" was not found in the current notebook.`);
        }
        const fulltext = await getNotebooklmSourceFulltextViaRpc(page, matched.id).catch(() => null);
        if (fulltext)
            return [fulltext];
        throw new EmptyResultError('opencli notebooklm source-fulltext', `NotebookLM fulltext was not available for source "${matched.title}".`);
    },
});

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Run `opencli notebooklm open <notebook-id-or-url>` before calling source-fulltext.
  2. Ensure the attached Chrome tab is on a specific notebook page (URL contains the notebook ID), not the home list.
  3. Re-open the session if the tab was closed or navigated, to refresh the adapter's page state.
  4. In scripts, call a state/`list` command first and branch to `open` when no notebook is active.

Example fix

// before: assuming a notebook is open
const rows = await runCommand('notebooklm source-fulltext', { source: 'specs.pdf' });
// after: open the notebook first
await runCommand('notebooklm open', { notebook: NOTEBOOK_ID });
const rows = await runCommand('notebooklm source-fulltext', { source: 'specs.pdf' });
Defensive patterns

Strategy: validation

Validate before calling

const state = await getNotebooklmPageState(page);
if (state.kind !== 'notebook') {
  await runCommand('notebooklm open', { notebook: NOTEBOOK_ID }); // open before fulltext
}

Try / catch

try {
  const rows = await runCommand('notebooklm source-fulltext', { source });
} catch (e) {
  if (e instanceof EmptyResultError && e.message.includes('Run `opencli notebooklm open')) {
    await runCommand('notebooklm open', { notebook: NOTEBOOK_ID });
    // retry the fulltext command
  } else throw e;
}

Prevention

When it happens

Trigger: Running `opencli notebooklm source-fulltext` before any notebook was opened; the attached page is the NotebookLM home/notebook-list view rather than a specific notebook; the notebook tab was closed or navigated away, resetting the page state.

Common situations: Fresh CLI session where only `notebooklm login` was run; user navigated the attached Chrome tab back to the home page; state.kind detection fails after a NotebookLM UI update restructures the page.

Related errors


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