jackwener/OpenCLI · error · CommandExecutionError
NotebookLM ${action} succeeded but source ${sourceId} did no
Error message
NotebookLM ${action} succeeded but source ${sourceId} did not appear in the notebook's source list What it means
After confirming the notebook exists, verifyNotebooklmSourceAdded searches the parsed source list for the given sourceId; if no source matches it throws this CommandExecutionError. It means the add-source action reported success, but the new source never appeared in the notebook's source list as observed through the detail RPC.
Source
Thrown at clis/notebooklm/utils.js:494
throw new CommandExecutionError(`NotebookLM ${action} succeeded but the notebook ${notebookId} was not found in the post-write verification`);
}
return detail;
}
catch (error) {
if (error instanceof AuthRequiredError || error instanceof CommandExecutionError)
throw error;
throw new CommandExecutionError(`NotebookLM ${action} post-write verification failed: ${error?.message || error}`);
}
}
export async function verifyNotebooklmSourceAdded(page, notebookId, sourceId, action) {
try {
const { detail, sources } = await getNotebooklmNotebookDetailById(page, notebookId);
if (!detail || detail.id !== notebookId) {
throw new CommandExecutionError(`NotebookLM ${action} succeeded but the notebook ${notebookId} was not found in the post-write verification`);
}
const matched = sources.find((s) => s.id === sourceId);
if (!matched) {
throw new CommandExecutionError(`NotebookLM ${action} succeeded but source ${sourceId} did not appear in the notebook's source list`);
}
return matched;
}
catch (error) {
if (error instanceof AuthRequiredError || error instanceof CommandExecutionError)
throw error;
throw new CommandExecutionError(`NotebookLM ${action} post-write verification failed: ${error?.message || error}`);
}
}
export async function listNotebooklmSourcesViaRpc(page) {
const state = await getNotebooklmPageState(page);
if (state.kind !== 'notebook' || !state.notebookId)
return [];
const rpc = await callNotebooklmRpc(page, NOTEBOOKLM_NOTEBOOK_DETAIL_RPC_ID, [state.notebookId, null, [2], null, 0]);
return parseNotebooklmSourceListResult(rpc.result);
}
export async function listNotebooklmHistoryViaRpc(page) {
const state = await getNotebooklmPageState(page);View on GitHub (pinned to 49907e53dc)
Solutions
- Retry verification after a delay — NotebookLM may index new sources asynchronously
- Compare the full parsed source list against the expected sourceId to see if the id differs (e.g. re-add and use the returned id)
- Reload the notebook page and re-run verification to eliminate stale page state
- Re-run the add-source action if the source genuinely never persisted
- Check for library updates if NotebookLM changed the detail payload layout
Example fix
// before: immediate verify
await addNotebooklmSource(page, nb, src);
await verifyNotebooklmSourceAdded(page, nb, src.id, 'add-source');
// after: eventual-consistency retry
for (let i = 0; i < 5; i++) {
try { await verifyNotebooklmSourceAdded(page, nb, src.id, 'add-source'); break; }
catch (e) {
if (!/did not appear in the notebook's source list/.test(e.message) || i === 4) throw e;
await page.wait(2);
}
} Defensive patterns
Strategy: retry
Validate before calling
// sanity-check sourceId format before verification
if (typeof sourceId !== 'string' || !sourceId.trim()) {
throw new Error('Invalid sourceId passed to verification');
} Type guard
function sourceInList(sources, sourceId) {
return Array.isArray(sources) && sources.some((s) => s?.id === sourceId);
} Try / catch
try {
await verifyNotebooklmSourceAdded(page, notebookId, sourceId, action);
} catch (e) {
if (!/did not appear in the notebook's source list/.test(e.message) || attempts >= 4) throw e;
await page.wait(2); // NotebookLM may index sources asynchronously
// retry verification
} Prevention
- Retry verification with backoff — new sources can appear with delay
- Use the exact sourceId returned by the add-source call
- Avoid duplicate concurrent add-source calls to the same notebook
- Reload page state if verification repeatedly fails
- Check for library updates if source list parsing changes
When it happens
Trigger: Calling verifyNotebooklmSourceAdded when sources.find((s) => s.id === sourceId) finds nothing — the source list parsed from the detail RPC contains no entry with that id (add silently failed, wrong sourceId returned by the add call, or list parsing missed the new entry).
Common situations: NotebookLM rejected/async-processed the add so the source isn't in the list yet; the sourceId returned by the add action differs from what's stored; RPC schema change altered how sources are embedded in the detail payload; duplicate concurrent adds confusing state.
Related errors
- NotebookLM ${action} succeeded but the notebook ${notebookId
- NotebookLM ${action} post-write verification failed: ${error
- NOTEBOOKLM_TOKENS
- Failed to delete list ${listId}: list still appears in manag
- Not a git repository
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/c02f218c9a45565d.
Report an issue: GitHub.