diff --git a/AI/lib/cli.js b/AI/lib/cli.js index 425a4b6..49d1a80 100644 --- a/AI/lib/cli.js +++ b/AI/lib/cli.js @@ -111,9 +111,15 @@ async function cmdAsk() { let r; try { + // section and kind must be forwarded here too. They were not, so both filters worked + // under `search` and were silently ignored under `ask` — the documented + // --section=CONFIGURATION usage retrieved from the whole index and the answer looked + // plausible, which is the worst way for a filter to fail. r = await search({ dbPath: db, url, embedModel: embed, query: q, k: parseInt(arg('k', '6'), 10), perFile: parseInt(arg('per-file', '2'), 10), + section: arg('section', null), + kind: arg('kind', null), }); } catch (e) { fail(`retrieval failed: ${e.message}`, 2);