mirror of
https://github.com/openai/codex.git
synced 2026-11-07 20:30:33 +00:00
Preserve configured Flex tiers without catalog or fast-mode support (#46230)
## Why An explicit `service_tier = "flex"` could be dropped when fast mode was disabled or the model catalog did not advertise Flex, even though Flex is an API request option. ## What changed - Preserve configured `flex` through core session settings, TUI tier resolution, and request construction regardless of fast-mode or catalog support. - Omit `service_tier` from Amazon Bedrock requests, including with custom catalogs, because Bedrock only supports the implicit default tier. ## Testing Add regression coverage for Flex configured at startup or through thread settings, connected thread startup, and TUI turn submission. Update review coverage to expect Flex with fast mode disabled, and verify that both Bedrock providers omit `service_tier`. GitOrigin-RevId: 98f2761bdd780603839ebfec75cb983a5d55e554
This commit is contained in:
@@ -867,9 +867,12 @@ impl ModelPreset {
|
||||
|
||||
impl ModelInfo {
|
||||
pub fn supports_service_tier(&self, service_tier: &str) -> bool {
|
||||
self.service_tiers
|
||||
.iter()
|
||||
.any(|tier| tier.id == service_tier)
|
||||
// Flex is an API request option, even when the Codex catalog does not advertise it.
|
||||
service_tier == ServiceTier::Flex.request_value()
|
||||
|| self
|
||||
.service_tiers
|
||||
.iter()
|
||||
.any(|tier| tier.id == service_tier)
|
||||
}
|
||||
|
||||
pub fn service_tier_for_request(&self, service_tier: Option<String>) -> Option<String> {
|
||||
@@ -1839,6 +1842,19 @@ mod tests {
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn service_tier_for_request_preserves_flex_without_catalog_support() {
|
||||
let model = ModelInfo {
|
||||
service_tiers: Vec::new(),
|
||||
..test_model(/*spec*/ None)
|
||||
};
|
||||
|
||||
assert_eq!(
|
||||
model.service_tier_for_request(Some(ServiceTier::Flex.request_value().to_string())),
|
||||
Some(ServiceTier::Flex.request_value().to_string())
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn service_tier_for_request_filters_unsupported_tiers() {
|
||||
let model = ModelInfo {
|
||||
|
||||
Reference in New Issue
Block a user