{"record":{"id":"15b001083b57e494","repo":"jackwener/OpenCLI","slug":"no-notebooklm-notebook-is-open-in-the-adapter-sess-15b001","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/summary.js","lineNumber":20,"sourceCode":"import { EmptyResultError } from '@jackwener/opencli/errors';\nimport { NOTEBOOKLM_DOMAIN, NOTEBOOKLM_SITE } from './shared.js';\nimport { getNotebooklmPageState, getNotebooklmSummaryViaRpc, readNotebooklmSummaryFromPage, requireNotebooklmSession, } from './utils.js';\ncli({\n    site: NOTEBOOKLM_SITE,\n    name: 'summary',\n    access: 'read',\n    description: 'Get the summary block from the currently opened NotebookLM notebook',\n    domain: NOTEBOOKLM_DOMAIN,\n    strategy: Strategy.COOKIE,\n    browser: true,\n    navigateBefore: false,\n    args: [],\n    columns: ['title', 'summary', 'source', 'url'],\n    func: async (page) => {\n        await requireNotebooklmSession(page);\n        const state = await getNotebooklmPageState(page);\n        if (state.kind !== 'notebook') {\n            throw new EmptyResultError('opencli notebooklm summary', 'No NotebookLM notebook is open in the adapter session. Run `opencli notebooklm open <notebook>` first.');\n        }\n        const domSummary = await readNotebooklmSummaryFromPage(page);\n        if (domSummary)\n            return [domSummary];\n        const rpcSummary = await getNotebooklmSummaryViaRpc(page).catch(() => null);\n        if (rpcSummary)\n            return [rpcSummary];\n        throw new EmptyResultError('opencli notebooklm summary', 'NotebookLM summary was not found on the current page.');\n    },\n});\n","sourceCodeStart":2,"sourceCodeEnd":31,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/notebooklm/summary.js#L2-L31","documentation":"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.","triggerScenarios":"`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.","commonSituations":"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.","solutions":["Run `opencli notebooklm open <notebook>` before summary.","Confirm with `opencli notebooklm current` that a notebook is active.","Re-authenticate if bounced to home/login, then reopen the notebook."],"exampleFix":"// before\nopencli notebooklm summary   # no notebook open\n// after\nopencli notebooklm open \"Research Notebook\"\nopencli notebooklm summary","handlingStrategy":"validation","validationCode":"const current = await exec('opencli notebooklm current --json');\nif (!current?.id) { await exec('opencli notebooklm open \"My Notebook\"'); }\n// then run summary","typeGuard":"function isNotebookOpen(state) {\n  return state?.kind === 'notebook' && typeof state?.notebookId === 'string' && state.notebookId.length > 0;\n}","tryCatchPattern":"try {\n  return await run('opencli notebooklm summary');\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 summary');\n  }\n  throw err;\n}","preventionTips":["Always open the notebook before requesting the summary.","Confirm active notebook via `opencli notebooklm current`.","Re-run open after any session/auth interruption.","Avoid navigating the adapter tab away from the notebook 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"}