[claude] Wire QuotaMonitor.select_model() into cascade router (#1106) #1113

Merged
claude merged 1 commits from claude/issue-1106 into main 2026-03-23 18:13:17 +00:00

1 Commits

Author SHA1 Message Date
Alexander Whitestone
8d6078aea9 feat: wire QuotaMonitor.select_model() into cascade router metabolic protocol
Some checks failed
Tests / lint (pull_request) Successful in 14s
Tests / test (pull_request) Failing after 29m26s
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>
2026-03-23 14:12:32 -04:00