You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tidy chunking.py: extract _chunk_bytes, name quota sentinel, use math.prod
Three small simplifications, no behavior change:
- Extract _chunk_bytes(chunk) helper for len(",".join(map(str, chunk))).
Used in both _worst_case_args and _plan_chunks; the helper documents
the cost model the planner compares chunks under.
- Name the magic sentinel 10**9 as _QUOTA_UNKNOWN. _read_remaining
returns it on missing/malformed x-ratelimit-remaining headers; having
one definition prevents the value from drifting between branches.
- Use math.prod for the cartesian-product cardinality calculation in
_plan_chunks (max_chunks check) and the wrapper (quota-floor loop
bound). Replaces an open-coded multiply-loop in two places.
All 25 chunker tests and 88 filter tests still pass.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments