From e11dc8c457d6a3e327cbf476ab17a44424aef4c2 Mon Sep 17 00:00:00 2001 From: claude Date: Thu, 10 Sep 2026 21:32:00 -0400 Subject: [PATCH] fix(index): %d can't format the "(all)" label-count fallback MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `label_count or "(all)"` yields a str when --limit isn't passed (the normal CI path), so the %d placeholder raised TypeError: %d format: a real number is required, not str on every indexing run. logging swallows the error, so the index still built correctly and CI stayed green — it just printed a stack trace instead of the summary line. Visible in every refresh/build log. %s formats both the int and the string fallback. Verified both paths: no --limit -> "loaded 218633 chunks from (all) label(s) in 6.6s" --limit 5 -> "loaded 180 chunks from 5 label(s) in 0.0s" Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01FFBDnRWHispovmJVK9rXc9 --- rag/index.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rag/index.py b/rag/index.py index 6eccbbd..79529bf 100644 --- a/rag/index.py +++ b/rag/index.py @@ -160,7 +160,7 @@ def main() -> int: label_count += 1 last_label_key = key records.append(rec) - log.info("loaded %d chunks from %d label(s) in %.1fs", + log.info("loaded %d chunks from %s label(s) in %.1fs", len(records), label_count or "(all)", time.time() - t0) if args.bm25_only: -- 2.54.0