[claude] Wire QuotaMonitor.select_model() into cascade router (#1106) #1113
Reference in New Issue
Block a user
Delete Branch "claude/issue-1106"
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 #1106
Summary
CascadeRouter._quota_allows_cloud()to useQuotaMonitor.select_model("high")instead ofshould_use_cloud(), aligning it with the metabolic protocol thresholds:TestMetabolicProtocol(5 tests) covering BURST/ACTIVE/RESTING tier behaviour plus graceful degradation when the quota monitor is unavailablesrc/infrastructure/claude_quota.pyandscripts/claude_quota_check.shwere already committed in prior work.Update _quota_allows_cloud() to use select_model("high") instead of should_use_cloud(), so the cascade router uses the same metabolic tier logic as the standalone quota API: - BURST tier (5h < 50%): cloud providers allowed - ACTIVE tier (5h >= 50%): cloud providers skipped, local 14B used - RESTING tier (7d >= 80%): cloud providers skipped, local 8B used Adds log message showing tier name and suggested local model when downshifting, so Alexander can verify the protocol is working. Adds TestMetabolicProtocol test class (5 tests) covering: - BURST tier allows cloud - ACTIVE tier skips cloud - RESTING tier skips cloud - Local (ollama) providers always attempted regardless of quota - No quota monitor → cloud allowed (graceful degradation) Files src/infrastructure/claude_quota.py and scripts/claude_quota_check.sh were already in place from prior work. Fixes #1106 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>