Chore: remove response model check and rely on header model for downgrade (#12061)

### Summary
Ensure that we use the model value from the response header only so that
we are guaranteed with the correct slug name. We are no longer checking
against the model value from response so that we are less likely to have
false positive.

There are two different treatments - for SSE we use the header from the
response and for websocket we check top-level events.
This commit is contained in:
Shijie Rao
2026-02-17 17:50:06 -08:00
committed by GitHub
Unverified
parent 31cbebd3c2
commit b3a8571219
5 changed files with 126 additions and 63 deletions
+3 -1
View File
@@ -2440,7 +2440,9 @@ impl Session {
server_model: String,
) -> bool {
let requested_model = turn_context.model_info.slug.clone();
if server_model == requested_model {
let server_model_normalized = server_model.to_ascii_lowercase();
let requested_model_normalized = requested_model.to_ascii_lowercase();
if server_model_normalized == requested_model_normalized {
info!("server reported model {server_model} (matches requested model)");
return false;
}