{"record":{"id":"b1886e722a276310","repo":"jackwener/OpenCLI","slug":"notebooklm-open-expected-notebook-notebookid","errorCode":null,"errorMessage":"[notebooklm open] expected notebook \"${notebookId}\" but page reports \"${state.notebookId}\"; continuing","messagePattern":"\\[notebooklm open\\] expected notebook \"(.+?)\" but page reports \"(.+?)\"; continuing","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"clis/notebooklm/open.js","lineNumber":34,"sourceCode":"        {\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":16,"sourceCodeEnd":43,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/notebooklm/open.js#L16-L43","documentation":"After navigating to a NotebookLM notebook, the page state reports a different notebook id than the one requested. The library only warns and continues, because the page did open a valid notebook — the id mismatch may come from redirects, id normalization, or stale client state.","triggerScenarios":"opencli notebooklm open <id> navigates, requireNotebooklmSession and getNotebooklmPageState succeed with kind 'notebook', but state.notebookId !== notebookId.","commonSituations":"NotebookLM redirecting to a canonical/different notebook URL, passing a truncated or URL-decoded variant of the id, sharing links resolving to an alias notebook, recent id format change on NotebookLM's side.","solutions":["Confirm the id with `opencli notebooklm list -f json` and pass the exact current id","Re-run the open command — transient redirects sometimes resolve correctly on retry","Check whether the requested notebook still exists or was merged/renamed; a wrong id may now point elsewhere","If the mismatch is benign (alias/canonical id), ignore the warning since metadata is still read from the live page"],"exampleFix":"// before\nopencli notebooklm open nb-OLD-ALIAS\n// after: use canonical id from list\nopencli notebooklm list -f json\nopencli notebooklm open nb-CANONICAL-ID","handlingStrategy":"validation","validationCode":"const listed = await run('opencli notebooklm list -f json');\nconst valid = JSON.parse(listed).some(n => n.id === notebookId);\nif (!valid) throw new Error(`Unknown notebook id: ${notebookId}`);","typeGuard":"const isSameNotebook = (state, id) => state.kind === 'notebook' && state.notebookId === id;","tryCatchPattern":"try {\n  await opencliNotebooklmOpen(notebookId);\n} catch (err) {\n  if (err.code === 'NOTEBOOKLM_OPEN_FAILED') { /* re-list notebooks and retry with canonical id */ }\n}","preventionTips":["Always source notebook ids from `notebooklm list -f json`, not from URLs or memory","Note that mismatch warnings may be benign (canonical vs alias ids); verify metadata matches","Retry once on transient redirect mismatches","Confirm the notebook still exists after renames/merges"],"tags":["notebooklm","id-mismatch","navigation","warning"],"backgroundTag":"resource-id-mismatch","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}