{"record":{"id":"109101cbd3cbac50","repo":"jackwener/OpenCLI","slug":"no-notebooklm-notebook-is-open-in-the-adapter-sess","errorCode":null,"errorMessage":"No NotebookLM notebook is open in the adapter session. Run `opencli notebooklm open <notebook>` first.","messagePattern":"No NotebookLM notebook is open in the adapter session\\. Run `opencli notebooklm open <notebook>` first\\.","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"error","filePath":"clis/notebooklm/source-fulltext.js","lineNumber":27,"sourceCode":"    description: 'Get the extracted fulltext for one source in the currently opened NotebookLM notebook',\n    domain: NOTEBOOKLM_DOMAIN,\n    strategy: Strategy.COOKIE,\n    browser: true,\n    navigateBefore: false,\n    args: [\n        {\n            name: 'source',\n            positional: true,\n            required: true,\n            help: 'Source id or title from the current notebook',\n        },\n    ],\n    columns: ['title', 'kind', 'char_count', 'url', 'source'],\n    func: async (page, kwargs) => {\n        await requireNotebooklmSession(page);\n        const state = await getNotebooklmPageState(page);\n        if (state.kind !== 'notebook') {\n            throw new EmptyResultError('opencli notebooklm source-fulltext', 'No NotebookLM notebook is open in the adapter session. Run `opencli notebooklm open <notebook>` first.');\n        }\n        const rpcRows = await listNotebooklmSourcesViaRpc(page).catch(() => []);\n        const rows = rpcRows.length > 0 ? rpcRows : await listNotebooklmSourcesFromPage(page);\n        if (rows.length === 0) {\n            throw new EmptyResultError('opencli notebooklm source-fulltext', 'No NotebookLM sources were found on the current page.');\n        }\n        const query = typeof kwargs.source === 'string' ? kwargs.source : String(kwargs.source ?? '');\n        const matched = findNotebooklmSourceRow(rows, query);\n        if (!matched) {\n            throw new EmptyResultError('opencli notebooklm source-fulltext', `Source \"${query}\" was not found in the current notebook.`);\n        }\n        const fulltext = await getNotebooklmSourceFulltextViaRpc(page, matched.id).catch(() => null);\n        if (fulltext)\n            return [fulltext];\n        throw new EmptyResultError('opencli notebooklm source-fulltext', `NotebookLM fulltext was not available for source \"${matched.title}\".`);\n    },\n});\n","sourceCodeStart":9,"sourceCodeEnd":45,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/notebooklm/source-fulltext.js#L9-L45","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Run `opencli notebooklm open <notebook-id-or-url>` before calling source-fulltext.","Ensure the attached Chrome tab is on a specific notebook page (URL contains the notebook ID), not the home list.","Re-open the session if the tab was closed or navigated, to refresh the adapter's page state.","In scripts, call a state/`list` command first and branch to `open` when no notebook is active."],"exampleFix":"// before: assuming a notebook is open\nconst rows = await runCommand('notebooklm source-fulltext', { source: 'specs.pdf' });\n// after: open the notebook first\nawait runCommand('notebooklm open', { notebook: NOTEBOOK_ID });\nconst rows = await runCommand('notebooklm source-fulltext', { source: 'specs.pdf' });","handlingStrategy":"validation","validationCode":"const state = await getNotebooklmPageState(page);\nif (state.kind !== 'notebook') {\n  await runCommand('notebooklm open', { notebook: NOTEBOOK_ID }); // open before fulltext\n}","typeGuard":null,"tryCatchPattern":"try {\n  const rows = await runCommand('notebooklm source-fulltext', { source });\n} catch (e) {\n  if (e instanceof EmptyResultError && e.message.includes('Run `opencli notebooklm open')) {\n    await runCommand('notebooklm open', { notebook: NOTEBOOK_ID });\n    // retry the fulltext command\n  } else throw e;\n}","preventionTips":["Always call `notebooklm open <notebook>` before source-level commands in scripts.","Check page state (or run a list command) before fulltext operations.","Don't navigate the attached Chrome tab away from the notebook during a session.","Structure workflows as open → operate, never operate on a fresh session."],"tags":["empty-result","session-state","notebooklm","cli-usage"],"backgroundTag":"no-active-session","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}