{"record":{"id":"5056241f0a7ce5bb","repo":"jackwener/OpenCLI","slug":"no-notebooklm-notebook-is-open-in-the-adapter-sess-505624","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-guide.js","lineNumber":27,"sourceCode":"    description: 'Get the guide summary and keywords 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: ['source_id', 'notebook_id', 'title', 'type', 'summary', 'keywords', '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-guide', '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-guide', '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-guide', `Source \"${query}\" was not found in the current notebook.`);\n        }\n        const guide = await getNotebooklmSourceGuideViaRpc(page, matched).catch(() => null);\n        if (guide)\n            return [guide];\n        throw new EmptyResultError('opencli notebooklm source-guide', `NotebookLM guide 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-guide.js#L9-L45","documentation":"opencli notebooklm source-guide throws this EmptyResultError when the adapter session page is not currently on a notebook (state.kind !== 'notebook'). Source guides (FAQ/summaries per source) require an open notebook context, so the command fails fast before any listing.","triggerScenarios":"Running `opencli notebooklm source-guide` while the browser page is on the NotebookLM home screen, a non-NotebookLM URL, or an unrecognized page, i.e. after forgetting `opencli notebooklm open <notebook>` or after the tab navigated away.","commonSituations":"Fresh adapter session with no notebook opened; previous notebook tab closed or redirected; NotebookLM forced a return to home due to auth expiry so the /notebook/<id> URL was lost.","solutions":["Run `opencli notebooklm open <notebook>` first, then retry source-guide.","Verify with `opencli notebooklm current` that a notebook is active.","Re-authenticate if the session bounced to home/login, then reopen the notebook."],"exampleFix":"// before\nopencli notebooklm source-guide --source \"specs\"\n// after\nopencli notebooklm open \"Product Docs\"\nopencli notebooklm source-guide --source \"specs\"","handlingStrategy":"validation","validationCode":"const current = await exec('opencli notebooklm current --json');\nif (!current?.id) { await exec('opencli notebooklm open \"My Notebook\"'); }\n// then run source-guide","typeGuard":"function isNotebookOpen(state) {\n  return state?.kind === 'notebook' && typeof state?.notebookId === 'string' && state.notebookId.length > 0;\n}","tryCatchPattern":"try {\n  await run('opencli notebooklm source-guide', ['--source', name]);\n} catch (err) {\n  if (/No NotebookLM notebook is open/.test(err.message)) {\n    await run('opencli notebooklm open', [notebook]);\n    return run('opencli notebooklm source-guide', ['--source', name]);\n  }\n  throw err;\n}","preventionTips":["Open the notebook explicitly before guide commands in every session.","Verify active notebook with `opencli notebooklm current` first.","Re-run open after any auth redirect or page navigation.","Don't share/reuse the adapter tab for other browsing during automation."],"tags":["notebooklm","prerequisite-not-met","browser-adapter"],"backgroundTag":"notebooklm-no-notebook-open","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}