Honor ChatGPT model maximum context windows

This commit is contained in:
2026-08-31 00:10:45 -05:00
parent 1c7d3c175d
commit 4a3a6c7848
2 changed files with 16 additions and 2 deletions
+9 -1
View File
@@ -2742,7 +2742,15 @@ fn openai_model_context_window(
is_configurable: max_context_size > default_context_size,
min: default_context_size,
max: max_context_size,
default_max: default_context_size,
// ChatGPT's catalog exposes `context_window` as the effective window
// and `max_context_window` as the model's actual maximum. Use the
// latter as the default so model refreshes do not reset the profile
// to the smaller effective window (for example, 272k).
default_max: if provider_kind == OpenAIProviderKind::ChatGPTSubscription {
max_context_size
} else {
default_context_size
},
}
}