jackwener/OpenCLI · error · EmptyResultError
Source "${query}" was not found in the current notebook.
Error message
Source "${query}" was not found in the current notebook. What it means
After loading the notebook's source rows, source-fulltext matches the user's --source query with findNotebooklmSourceRow; if no row matches the given title/ID/substring, it throws an EmptyResultError naming the query. This is a lookup miss, not a transport problem — the notebook has sources, just not one matching the query.
Source
Thrown at clis/notebooklm/source-fulltext.js:37
help: 'Source id or title from the current notebook',
},
],
columns: ['title', 'kind', 'char_count', 'url', 'source'],
func: async (page, kwargs) => {
await requireNotebooklmSession(page);
const state = await getNotebooklmPageState(page);
if (state.kind !== 'notebook') {
throw new EmptyResultError('opencli notebooklm source-fulltext', 'No NotebookLM notebook is open in the adapter session. Run `opencli notebooklm open <notebook>` first.');
}
const rpcRows = await listNotebooklmSourcesViaRpc(page).catch(() => []);
const rows = rpcRows.length > 0 ? rpcRows : await listNotebooklmSourcesFromPage(page);
if (rows.length === 0) {
throw new EmptyResultError('opencli notebooklm source-fulltext', 'No NotebookLM sources were found on the current page.');
}
const query = typeof kwargs.source === 'string' ? kwargs.source : String(kwargs.source ?? '');
const matched = findNotebooklmSourceRow(rows, query);
if (!matched) {
throw new EmptyResultError('opencli notebooklm source-fulltext', `Source "${query}" was not found in the current notebook.`);
}
const fulltext = await getNotebooklmSourceFulltextViaRpc(page, matched.id).catch(() => null);
if (fulltext)
return [fulltext];
throw new EmptyResultError('opencli notebooklm source-fulltext', `NotebookLM fulltext was not available for source "${matched.title}".`);
},
});
View on GitHub (pinned to 49907e53dc)
Solutions
- Run the notebook's source list command and copy an exact title or ID from its output.
- Check for typos and try a shorter distinctive substring of the title.
- Confirm you are querying the notebook you intend (re-open the correct notebook).
- If the source was renamed or deleted, re-add it or update the script's configured source name.
Example fix
// before: hardcoded possibly-stale name
const text = await sourceFulltext('Q3 Report Final v2');
// after: resolve the name from the live source list
const sources = await listSources();
const match = sources.find(s => s.title.includes('Q3'));
const text = await sourceFulltext(match.id); Defensive patterns
Strategy: validation
Validate before calling
const sources = await runCommand('notebooklm source-list');
const exact = sources.find(s => s.title === wanted || s.id === wanted);
if (!exact) throw new Error(`"${wanted}" not in source list; available: ${sources.map(s => s.title).join(', ')}`); Try / catch
try {
const rows = await runCommand('notebooklm source-fulltext', { source: query });
} catch (e) {
if (e instanceof EmptyResultError && e.message.includes('was not found in the current notebook')) {
// list sources, prompt user to pick or correct the query, then retry
} else throw e;
} Prevention
- Resolve source names from a live source-list call, never hardcoded strings.
- Prefer stable source IDs over titles in scripts.
- Use short distinctive substrings rather than exact long titles.
- Refresh cached source names whenever the notebook is edited.
When it happens
Trigger: Passing a source name that doesn't exist in the notebook, a misspelled title, a stale ID after the source was deleted, a title that changed, or a query whose casing/punctuation differs from the stored title and defeats the matcher.
Common situations: Hardcoding source names in scripts after the notebook was edited; using a truncated or paraphrased title; sourcing from a different notebook than assumed; renamed sources.
Understand the failure class
Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.
Related errors
- Source "${query}" was not found in the current notebook.
- Source "${query}" was not found in the current notebook.
- bilibili creator-stats ${bvid}
- 未找到该候选人
- 未找到该聊天(geek 侧)
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/831e61625fc7ccbf.
Report an issue: GitHub.