{"record":{"id":"a90e762c64e26597","repo":"jackwener/OpenCLI","slug":"notebooklm-open-failed","errorCode":"NOTEBOOKLM_OPEN_FAILED","errorMessage":"NOTEBOOKLM_OPEN_FAILED","messagePattern":"NOTEBOOKLM_OPEN_FAILED","errorType":"error_code","errorClass":"CliError","httpStatus":null,"severity":"error","filePath":"clis/notebooklm/open.js","lineNumber":31,"sourceCode":"    browser: true,\n    navigateBefore: false,\n    args: [\n        {\n            name: 'notebook',\n            positional: true,\n            required: true,\n            help: 'Notebook id from list output, or a full NotebookLM notebook URL',\n        },\n    ],\n    columns: ['id', 'title', 'url', 'source'],\n    func: async (page, kwargs) => {\n        const notebookId = parseNotebooklmNotebookTarget(String(kwargs.notebook ?? ''));\n        await page.goto(buildNotebooklmNotebookUrl(notebookId));\n        await page.wait(2);\n        await requireNotebooklmSession(page);\n        const state = await getNotebooklmPageState(page);\n        if (state.kind !== 'notebook') {\n            throw new CliError('NOTEBOOKLM_OPEN_FAILED', `NotebookLM notebook \"${notebookId}\" did not open in the adapter session`, 'Run `opencli notebooklm list -f json` first and pass a valid notebook id.');\n        }\n        if (state.notebookId !== notebookId) {\n            console.warn(`[notebooklm open] expected notebook \"${notebookId}\" but page reports \"${state.notebookId}\"; continuing`);\n        }\n        const current = await readCurrentNotebooklm(page);\n        if (!current) {\n            throw new EmptyResultError('opencli notebooklm open', 'NotebookLM notebook metadata was not found after navigation.');\n        }\n        return [current];\n    },\n});\n","sourceCodeStart":13,"sourceCodeEnd":43,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/notebooklm/open.js#L13-L43","documentation":"`opencli notebooklm open <notebook>` throws this CliError with code NOTEBOOKLM_OPEN_FAILED when, after navigating to the built notebook URL and waiting, the page state is still not kind 'notebook' — i.e. NotebookLM did not actually open the requested notebook in the adapter session. The suggested remediation is embedded in the error: get a valid id from `notebooklm list`.","triggerScenarios":"parseNotebooklmNotebookTarget produced an id (valid or not) whose notebook URL loaded something other than the notebook view: nonexistent/deleted notebook id, malformed id or URL, redirect to sign-in/error page, or a notebook the account cannot access.","commonSituations":"Hallucinated or copy-paste-truncated notebook id; notebook deleted by a teammate; sharing permission revoked; passing a URL from a different domain/account; expired session redirecting to login instead of the notebook.","solutions":["Run `opencli notebooklm list -f json` and pass an id exactly as listed.","Verify the notebook still exists and your account has access at notebooklm.google.com.","Re-authenticate the browser session if navigation redirects to a sign-in page.","If passing a URL, ensure it is a full NotebookLM notebook URL for the same account/domain."],"exampleFix":"// before\nopencli notebooklm open abc12   # truncated id -> NOTEBOOKLM_OPEN_FAILED\n// after\nopencli notebooklm list -f json\nopencli notebooklm open abc123def456-full-id","handlingStrategy":"validation","validationCode":"const notebooks = await run('opencli notebooklm list -f json');\nconst valid = notebooks.some(n => n.id === notebookId || n.url === notebookId);\nif (!valid) throw new Error(`Invalid notebook target: ${notebookId}`);","typeGuard":"function isValidNotebookTarget(target, notebooks) {\n  return notebooks.some(n => n.id === target || n.url === target);\n}","tryCatchPattern":"try {\n  await run(`opencli notebooklm open \"${id}\" -f json`);\n} catch (e) {\n  if (e.code === 'NOTEBOOKLM_OPEN_FAILED' || String(e.message).includes('did not open')) {\n    const list = await run('opencli notebooklm list -f json');\n    throw new Error(`Notebook ${id} unavailable. Known ids: ${list.map(n => n.id).join(', ')}`);\n  } else throw e;\n}","preventionTips":["Copy notebook ids directly from `notebooklm list` output, never by hand.","Check the notebook still exists and is shared with your account.","Re-authenticate if navigation lands on a sign-in page.","Validate any URL target points to notebooklm.google.com for the same account."],"tags":["notebooklm","navigation","invalid-id"],"backgroundTag":"notebook-open-failed","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}