Conversation
There was a problem hiding this comment.
Codex Review: Here are some suggestions.
Reply with @codex fix comments to fix any unresolved comments.
About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".
| chunks_path = _locate_chunks_file( | ||
| explicit_path=args.chunks_file, | ||
| chunks_dir=chunks_dir, | ||
| key_safe=key_safe, | ||
| index_dir=faiss_dir, | ||
| ) | ||
| if chunks_path is not None: | ||
| docs = _load_chunks_jsonl(chunks_path) | ||
|
|
||
| if not chunks_path.exists(): | ||
| elif args.mode in MODES_REQUIRING_CHUNKS: | ||
| raise SystemExit( | ||
| f"[lc_ask] chunks not found: {expected_chunks} – run lc_build_index for KEY={args.key}" | ||
| ) | ||
| else: | ||
| if expected_chunks is None: | ||
| raise SystemExit( | ||
| f"[lc_ask] chunks not found for index at {faiss_dir}. Provide --chunks-file" | ||
| ) | ||
| key_hint = key_arg or (key_safe if key_safe is not None else str(faiss_dir)) | ||
| display_key = args.key if args.key else key_safe | ||
| raise SystemExit( | ||
| f"[lc_ask] chunks not found: {chunks_path} – run lc_build_index for KEY={args.key}" | ||
| "[lc_ask] chunks not found: " | ||
| f"{expected_chunks} – run lc_build_index for {key_hint}" |
There was a problem hiding this comment.
[P1] Avoid aborting when chunks are missing for FAISS queries
The new constant MODES_REQUIRING_CHUNKS suggests lc_ask should tolerate missing chunk JSON when running in pure FAISS mode and fall back to vectorstore metadata, but the control flow still raises SystemExit whenever chunks_path cannot be located (lines 396‑418). With --mode faiss and a valid FAISS directory but no lc_chunks_<key>.jsonl, the code hits the else branch and exits before _extract_docs_from_vectorstore runs, so the command fails instead of using the index’s embedded documents. Users invoking lc_ask.py --key … --mode faiss on an index without saved chunks will still receive a “chunks not found” error. The fallback should only be enforced for modes listed in MODES_REQUIRING_CHUNKS and allow the FAISS-only case to proceed.
Useful? React with 👍 / 👎.
No description provided.