[
  {
    "prompt": "Split cascade.py (1241 lines) into 4 modules while maintaining backward compatibility. All imports from cascade.py must still work.\n\nSPLIT PLAN:\n\n1. Create `src/infrastructure/router/models.py` (~100 lines) with ALL data classes:\n   - ProviderStatus (Enum)\n   - CircuitState (Enum) \n   - ContentType (Enum)\n   - ProviderMetrics (dataclass)\n   - ModelCapability (dataclass)\n   - Provider (dataclass)\n   - RouterConfig (dataclass)\n   Include all needed imports (dataclass, field, Enum, etc.)\n\n2. Create `src/infrastructure/router/health.py` (~100 lines) - Health/circuit breaker mixin:\n   - Create class `HealthMixin` with methods: `_record_success`, `_record_failure`, `_open_circuit`, `_can_close_circuit`, `_close_circuit`, `_is_provider_available`, `_quota_allows_cloud`\n   - Import from models.py: ProviderStatus, CircuitState, Provider, ProviderMetrics\n   - Keep the quota monitor import at module level (the try/except block for QuotaMonitor)\n   - The mixin needs access to self.config (RouterConfig) and self.providers\n\n3. Create `src/infrastructure/router/providers.py` (~230 lines) - Provider API call mixin:\n   - Create class `ProviderCallsMixin` with methods: `_try_provider`, `_call_ollama`, `_transform_messages_for_ollama`, `_call_openai`, `_call_anthropic`, `_call_grok`, `_call_vllm_mlx`\n   - Import from models.py: Provider, ContentType\n   - Keep provider-specific imports (aiohttp, openai, anthropic, httpx) as lazy imports inside methods\n\n4. Trim `cascade.py` to thin orchestrator (~400 lines):\n   - Import everything from models.py at top\n   - CascadeRouter inherits from HealthMixin and ProviderCallsMixin\n   - Keep in cascade.py: `__init__`, `_load_config`, `_parse_router_config`, `_load_providers`, `_expand_env_vars`, `_check_provider_available`, `_detect_content_type`, `_get_fallback_model`, `_select_model`, `_attempt_with_retry`, `_filter_providers`, `_try_single_provider`, `_get_model_for_complexity`, `complete`, `reload_config`, `get_metrics`, `get_status`, `generate_",
    "chosen": "",
    "session": "session_20260324_143227_c5b949.json"
  }
]