{"record":{"id":"b4ba93318bb0f3f1","repo":"jackwener/OpenCLI","slug":"no-notebooklm-notebook-is-open-in-the-adapter-sess-b4ba93","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-list.js","lineNumber":20,"sourceCode":"import { EmptyResultError } from '@jackwener/opencli/errors';\nimport { NOTEBOOKLM_DOMAIN, NOTEBOOKLM_SITE } from './shared.js';\nimport { getNotebooklmPageState, listNotebooklmSourcesFromPage, listNotebooklmSourcesViaRpc, requireNotebooklmSession, } from './utils.js';\ncli({\n    site: NOTEBOOKLM_SITE,\n    name: 'source-list',\n    access: 'read',\n    description: 'List sources for the currently opened NotebookLM notebook',\n    domain: NOTEBOOKLM_DOMAIN,\n    strategy: Strategy.COOKIE,\n    browser: true,\n    navigateBefore: false,\n    args: [],\n    columns: ['title', 'id', 'type', 'size', 'created_at', 'updated_at', 'url', 'source'],\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 source-list', 'No NotebookLM notebook is open in the adapter session. Run `opencli notebooklm open <notebook>` first.');\n        }\n        const rpcRows = await listNotebooklmSourcesViaRpc(page).catch(() => []);\n        if (rpcRows.length > 0)\n            return rpcRows;\n        const domRows = await listNotebooklmSourcesFromPage(page);\n        if (domRows.length > 0)\n            return domRows;\n        throw new EmptyResultError('opencli notebooklm source-list', 'No NotebookLM sources were found on the current page.');\n    },\n});\n","sourceCodeStart":2,"sourceCodeEnd":31,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/notebooklm/source-list.js#L2-L31","documentation":"opencli notebooklm source-list throws this EmptyResultError when the session page is not a notebook page (state.kind !== 'notebook'), checked right after requireNotebooklmSession. Listing sources is meaningless outside a notebook, so the command aborts with an actionable hint.","triggerScenarios":"`opencli notebooklm source-list` executed while the adapter sits on the NotebookLM home/dashboard or a non-NotebookLM/unknown page (no /notebook/<id> in the URL), typically because no notebook was ever opened in this session.","commonSituations":"Starting a fresh session and running source-list before open; the notebook tab was closed or redirected to home after auth expiry; passing a home-page URL instead of a notebook URL.","solutions":["Run `opencli notebooklm open <notebook>` then `opencli notebooklm source-list`.","Check `opencli notebooklm current` to confirm which notebook is active.","Re-authenticate and reopen the notebook if the session was redirected to home."],"exampleFix":"// before\nopencli notebooklm source-list   # session on NotebookLM home\n// after\nopencli notebooklm open \"Research Notebook\"\nopencli notebooklm source-list","handlingStrategy":"validation","validationCode":"const current = await exec('opencli notebooklm current --json');\nif (!current?.id) await exec('opencli notebooklm open \"My Notebook\"');\n// now source-list is safe","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 source-list');\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-list');\n  }\n  throw err;\n}","preventionTips":["Run open before any source command in fresh sessions.","Gate automation on `opencli notebooklm current` returning a notebook.","Reopen the notebook after auth expiry redirects to home.","Use notebook URLs containing /notebook/<id> when opening."],"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"}