fix(batch_routing): remove dead build_jsonl_body - #967
Conversation
build_jsonl_body had zero callers outside its own test and, unlike its embeddings twin build_embeddings_jsonl_body, was never re-exported from __init__.py -- the real submission path (PgLlmBatchBackend._assemble_payload) builds JSONL lines directly via to_jsonl_line() and never calls it. Remove the hollow function and its dedicated test. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Warning Review limit reachedNext included review available in 57 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Cross-PR integration contract: routing identity is provider-neutral |
|
Two things on this PR:
Cross-PR Generated by Claude Code |
|
Contextual-Orchestrator와 관계한 것들을 같이 손보든 어쩌든 해결하세요. Bypass merge 필요하면 가능 (chicken and eggs 상황이라면) + NVIDIA NIM 만 쓰는 건 허용하지 않아요. Contextual-Orchestrator를 쓰세요. Timeout은 적어도 3시간으로 잡으세요. 120초 같은 건 당황스럽군요. |
|
Contextual-Orchestrator와 관계한 것들을 같이 손보든 어쩌든 해결하세요. Bypass merge 필요하면 가능 (chicken and eggs 상황이라면) + NVIDIA NIM 만 쓰는 건 허용하지 않아요. Contextual-Orchestrator를 쓰세요. Timeout은 적어도 3시간으로 잡으세요. 120초 같은 건 당황스럽군요. Strix가 6시간 이상 동작해서 취약점 잡는 것도 본 일이 있습니다. Opencode와 Noema 는 Coderabbitai 및 Devin 수준으로 실제로 리뷰를 하게 하시오. Strix도 보안 리뷰를 꼼꼼하게 하도록 하시오. 특히 보안 리뷰는 전체 코드로 수행하는 것입니다. Contextual-Orchestrator는 실시간으로 빠르면서 능력이 좋은 모델에 요청을 보내어 시간을 당기시오. |
|
Generated by Claude Code |
Summary
Removes a hollow/dead code path flagged by an org-wide audit responding to "빈 깡통 경로 너무 많다.." (too many empty-can/hollow-shell code paths).
build_jsonl_body(contextual_orchestrator/batch_routing.py) had zero callers outside its own dedicated test, and unlike its embeddings twinbuild_embeddings_jsonl_body, it was never re-exported from__init__.py. The real batch-submission path,PgLlmBatchBackend._assemble_payload, builds the JSONL lines directly via a list comprehension overBatchRequest.to_jsonl_line(...)— it never callsbuild_jsonl_body. So the function was pure unreferenced dead weight, not a stub for an unwired path.Independent verification before fixing
grep -rn "build_jsonl_body"across the whole repo: onlycontextual_orchestrator/batch_routing.py(definition) andtests/test_batch_routing.py(its own dedicated test) reference the name.contextual_orchestrator/__init__.pyre-exportsbuild_embeddings_jsonl_body,cheapest_upstream, etc., but neverbuild_jsonl_body— matching the finding's exact asymmetry claim.PgLlmBatchBackend._assemble_payloadand confirmed the production JSONL-assembly path is independent of this function ([request.to_jsonl_line(self._endpoint) for request in requests]), so nothing needs wiring — removal is correct rather than wiring-in.Changes
build_jsonl_bodyfromcontextual_orchestrator/batch_routing.py.test_build_jsonl_body_uses_openai_batch_line_shape) and now-unused import fromtests/test_batch_routing.py.Scoped to exactly this one finding — no other cleanup bundled in.
Verification
Run from an isolated clone, Python 3.12 (the
fast_mlsirmprivate-repo optional dependency, gated topython_full_version >= "3.12", could not be fetched in the sandbox — network-blocked for private GitHub archives — so it and its one dependent test were excluded; unrelated to this change, see the full test run below):Also ran the unmodified full suite once (before excluding the private-dep test) to confirm the only failure is the pre-existing
fast_mlsirmimport gap:1 failed, 2855 passed, 1 skipped— the single failure isModuleNotFoundError: No module named 'fast_mlsirm'intests/test_psychometric_routing.py, unrelated tobatch_routing.py.🤖 Generated with Claude Code
Generated by Claude Code