jackwener/OpenCLI · error · CommandExecutionError

Failed to open NotebookLM notebook ${notebookId}: ${error?.m

Error message

Failed to open NotebookLM notebook ${notebookId}: ${error?.message || error}

What it means

This CommandExecutionError wraps any failure while navigating the adapter page to the notebook URL during `notebooklm generate-slides`. Like the audio variant, it decorates the underlying goto/wait error with the notebookId for debuggability.

Source

Thrown at clis/notebooklm/generate-slides.js:83

    navigateBefore: false,
    args: [
        { name: 'notebook', positional: true, required: true, help: 'Notebook id from `notebooklm list` or full notebook URL' },
        { name: 'length', help: 'Slide deck length: 1=Short, 3=Default (default 3)' },
        { name: 'language', help: 'Language code (default en)' },
        { name: 'execute', type: 'boolean', help: 'Actually trigger remote NotebookLM slide deck generation' },
    ],
    columns: ['notebook_id', 'slides_id', 'source_count', 'status', 'notebook_url'],
    func: async (page, kwargs) => {
        const notebookId = parseNotebooklmNotebookTarget(String(kwargs.notebook ?? ''));
        const length = parseSlideDeckLength(kwargs.length);
        const language = String(kwargs.language ?? 'en').trim() || 'en';
        requireNotebooklmExecute(kwargs.execute, 'generate NotebookLM slides');
        try {
            await page.goto(buildNotebooklmNotebookUrl(notebookId));
            await page.wait(2);
        }
        catch (error) {
            throw new CommandExecutionError(`Failed to open NotebookLM notebook ${notebookId}: ${error?.message || error}`);
        }
        await requireNotebooklmSession(page);
        const sources = await listNotebooklmSourcesViaRpc(page);
        const sourceIds = sources.map((s) => s.id).filter((id) => typeof id === 'string' && id);
        if (sourceIds.length === 0) {
            throw new EmptyResultError('notebooklm generate-slides', 'The notebook has no sources; add a source before generating a slide deck.');
        }
        const rpc = await callNotebooklmRpc(page, NOTEBOOKLM_CREATE_ARTIFACT_RPC_ID, buildCreateSlidesArgs(notebookId, sourceIds, { length, language }));
        const slidesId = parseSlidesIdFromResult(rpc.result, [notebookId, ...sourceIds]);
        if (!slidesId) {
            throw new CommandExecutionError('NotebookLM CreateArtifact (slides) RPC returned no slide-deck id; the server may have rejected the request.');
        }
        return [{
            notebook_id: notebookId,
            slides_id: slidesId,
            source_count: sourceIds.length,
            status: 'pending',
            notebook_url: buildNotebooklmNotebookUrl(notebookId),

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Verify the notebookId (use `opencli notebooklm list` or `current`) and fix typos.
  2. Re-authenticate / refresh the NotebookLM session, then retry.
  3. Check network/proxy availability and that the adapter browser session is running.

Example fix

// before
opencli notebooklm generate-slides --notebook wrong-id
// after
opencli notebooklm current   # confirm id
opencli notebooklm generate-slides --notebook correct-id --length 3
Defensive patterns

Strategy: try-catch

Validate before calling

if (!notebookId || typeof notebookId !== 'string') throw new Error('notebookId required');
const notebooks = await runCli(['notebooklm', 'list']);
if (!notebooks.some((n) => n.id === notebookId)) throw new Error(`unknown notebookId: ${notebookId}`);

Type guard

const isValidNotebookId = (id) => typeof id === 'string' && id.trim().length > 0;

Try / catch

try {
  await generateSlides({ notebookId, length });
} catch (e) {
  if (String(e.message).startsWith('Failed to open NotebookLM notebook')) {
    await refreshNotebooklmSession();
    return await generateSlides({ notebookId, length });
  }
  throw e;
}

Prevention

When it happens

Trigger: `page.goto(buildNotebooklmNotebookUrl(notebookId))` or the subsequent wait throws — bad notebookId, expired session redirecting to login, network timeout, or dead browser tab.

Common situations: Notebook deleted or id mistyped so the URL 404s; NotebookLM session cookies expired; corporate proxy blocking the request.

Related errors


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/9c2155b5d0fcf856. Report an issue: GitHub.