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
opencli notebooklm source-guide throws this EmptyResultError when the notebook and sources are fine, but findNotebooklmSourceRow found no row matching the --source argument. The query stringified from kwargs.source matched zero listed sources.
Source
Thrown at clis/notebooklm/source-guide.js:37
help: 'Source id or title from the current notebook',
},
],
columns: ['source_id', 'notebook_id', 'title', 'type', 'summary', 'keywords', 'source'],
func: async (page, kwargs) => {
await requireNotebooklmSession(page);
const state = await getNotebooklmPageState(page);
if (state.kind !== 'notebook') {
throw new EmptyResultError('opencli notebooklm source-guide', '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-guide', '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-guide', `Source "${query}" was not found in the current notebook.`);
}
const guide = await getNotebooklmSourceGuideViaRpc(page, matched).catch(() => null);
if (guide)
return [guide];
throw new EmptyResultError('opencli notebooklm source-guide', `NotebookLM guide was not available for source "${matched.title}".`);
},
});
View on GitHub (pinned to 49907e53dc)
Solutions
- Run `opencli notebooklm source-list` to get exact source titles/ids.
- Retry with the exact title or id from the listing.
- Re-add the source if it was deleted; update scripts to reference the current title.
Example fix
// before opencli notebooklm source-guide --source "report" // after opencli notebooklm source-list # exact title: "Q3 Report" opencli notebooklm source-guide --source "Q3 Report"
Defensive patterns
Strategy: validation
Validate before calling
const sources = await exec('opencli notebooklm source-list --json');
const hit = sources.find(s => s.title === wanted || s.id === wanted);
if (!hit) throw new Error(`Source "${wanted}" not found; check source-list`); Type guard
function findSourceRow(rows, query) {
if (!Array.isArray(rows) || typeof query !== 'string') return null;
const q = query.trim().toLowerCase();
return rows.find(r => r?.title?.toLowerCase() === q || r?.id === query) ?? null;
} Try / catch
try {
return await run('opencli notebooklm source-guide', ['--source', name]);
} catch (err) {
if (/was not found in the current notebook/.test(err.message)) {
const rows = await run('opencli notebooklm source-list');
throw new Error(`"${name}" not found. Available: ${rows.map(r => r.title).join(', ')}`);
}
throw err;
} Prevention
- Look up exact titles via source-list before guide requests.
- Prefer source ids over titles in automation.
- Refresh listings after renaming or deleting sources.
- Trim/normalize query strings to avoid whitespace mismatches.
When it happens
Trigger: `opencli notebooklm source-guide --source "title"` where no source title or id matches the provided string: typo, renamed/deleted source, or passing a file path/URL instead of the listed title.
Common situations: Casing or wording differs from the NotebookLM source title; source removed since the last listing; using an id from a different notebook; quotes/spaces mismatch.
Related errors
- Source "${query}" was not found in the current notebook.
- Source "${query}" was not found in the current notebook.
- 未找到该候选人
- 未找到该聊天(geek 侧)
- uid 在招聘端与求职端聊天列表中均未找到
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/7f9508ee582c16c4.
Report an issue: GitHub.