Skip to content

update dev#205

Merged
pfahlr merged 9 commits into
devfrom
main
Sep 24, 2025
Merged

update dev#205
pfahlr merged 9 commits into
devfrom
main

Conversation

@pfahlr

@pfahlr pfahlr commented Sep 24, 2025

Copy link
Copy Markdown
Owner

No description provided.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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".

Comment thread src/langchain/lc_ask.py
Comment on lines +396 to +418
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}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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 👍 / 👎.

@pfahlr pfahlr merged commit 2131c8d into dev Sep 24, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant