[claude] refactor: break up cascade.py complete() (#1185) #1190
Reference in New Issue
Block a user
Delete Branch "claude/issue-1185"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #1185
Changes
Extracted two helpers from
complete()(84 lines → <25 lines):_filter_providers(cascade_tier)— isolates tier-based provider filtering logic_try_single_provider(...)— encapsulates per-provider attempt: availability check, quota gate, model selection, retry, and metrics recordingcomplete()now reads as a concise orchestration loop. No function exceeds 50 lines.Tests
Added 9 focused unit tests covering both helpers directly (
TestFilterProviders,TestTrySingleProvider). All 302 tests pass (tox -e unitgreen).