diff --git a/main.py b/main.py index 53d2b3f..3c412e3 100644 --- a/main.py +++ b/main.py @@ -401,6 +401,7 @@ async def proxy( # ── Determine target URL ────────────────────────────────────────────── target_url: Optional[str] = None error: Optional[str] = None + sidecar_status = None # Circuit breaker check if not await circuit_breaker_check(): @@ -487,6 +488,13 @@ async def proxy( target_url = f"{MAIN_PC_BASE}/{path}" else: error = "switch_failed" + circuit_record_failure() + print( + f"SWITCH FAILED: profile={requested_model}, " + f"sidecar_status={switch_result.get('status')}, " + f"message={switch_result.get('message', '(no message)')}", + flush=True, + ) except Exception as e: circuit_record_failure() error = f"switch_error: {str(e)}"