{"record":{"id":"34ffa6ed672d57be","repo":"jackwener/OpenCLI","slug":"opencli-notebooklm-history","errorCode":null,"errorMessage":"opencli notebooklm history","messagePattern":"opencli notebooklm history","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"error","filePath":"clis/notebooklm/history.js","lineNumber":20,"sourceCode":"import { EmptyResultError } from '@jackwener/opencli/errors';\nimport { NOTEBOOKLM_DOMAIN, NOTEBOOKLM_SITE } from './shared.js';\nimport { getNotebooklmPageState, listNotebooklmHistoryViaRpc, requireNotebooklmSession, } from './utils.js';\ncli({\n    site: NOTEBOOKLM_SITE,\n    name: 'history',\n    access: 'read',\n    description: 'List NotebookLM conversation history threads in the current notebook',\n    domain: NOTEBOOKLM_DOMAIN,\n    strategy: Strategy.COOKIE,\n    browser: true,\n    navigateBefore: false,\n    args: [],\n    columns: ['thread_id', 'item_count', 'preview', 'source', 'notebook_id', '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 history', 'No NotebookLM notebook is open in the adapter session. Run `opencli notebooklm open <notebook>` first.');\n        }\n        const rows = await listNotebooklmHistoryViaRpc(page);\n        return rows;\n    },\n});\n","sourceCodeStart":2,"sourceCodeEnd":26,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/notebooklm/history.js#L2-L26","documentation":"`opencli notebooklm history` throws this EmptyResultError when no notebook is currently open in the adapter session. The command requires a notebook context to fetch its chat history via listNotebooklmHistoryViaRpc, and getNotebooklmPageState reports a page kind other than 'notebook' (e.g. the home page or another surface).","triggerScenarios":"Calling `opencli notebooklm history` (args: []) when getNotebooklmPageState(page).kind !== 'notebook' — typically because `opencli notebooklm open <notebook>` was never run in this session, or the browser navigated away.","commonSituations":"Fresh adapter session where only `list` was run; previous `open` failed silently; session cookies expired and NotebookLM redirected to the home page; script reuses a page that last visited the notebook list.","solutions":["Run `opencli notebooklm open <notebook-id-or-url>` first, then retry `opencli notebooklm history`.","Verify with `opencli notebooklm list -f json` that the notebook id you pass to `open` is valid.","Re-authenticate / refresh the browser session cookies if NotebookLM keeps redirecting to the home page.","Keep the same page session alive between `open` and `history`; do not navigate the page in between."],"exampleFix":"// before\nopencli notebooklm history\n// after\nopencli notebooklm open abc123-notebook\nopencli notebooklm history","handlingStrategy":"validation","validationCode":"const state = await run('opencli notebooklm get -f json').catch(() => null);\nif (!state) throw new Error('No notebook open: run `opencli notebooklm open <notebook>` before history');","typeGuard":"function isNotebookOpen(state) {\n  return !!state && state.kind === 'notebook' && typeof state.id === 'string';\n}","tryCatchPattern":"try {\n  history = await run('opencli notebooklm history -f json');\n} catch (e) {\n  if (String(e.message).includes('notebooklm history')) {\n    await run('opencli notebooklm open <notebook-id>');\n    history = await run('opencli notebooklm history -f json');\n  } else throw e;\n}","preventionTips":["Script an explicit `open` step before any notebook-scoped command.","Do not navigate the shared page between `open` and `history`.","Watch for auth redirects that silently move the page off the notebook.","Keep the adapter session alive for the whole workflow."],"tags":["notebooklm","session-state","empty-result"],"backgroundTag":"empty-result-error","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}