File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38,13 +38,6 @@ const MAX_SUBSCRIPTION_AUTH_TIMEOUT: Duration = Duration::from_secs(30);
3838const LEGACY_CONTINUATION_METADATA : & str = "openai.subscription.v1" ;
3939const CONTINUATION_METADATA : & str = "openai.responses.continuation.v1" ;
4040
41- pub fn supported_model ( model : & str ) -> bool {
42- matches ! (
43- model,
44- "gpt-5.6-sol" | "gpt-5.5" | "gpt-5.4" | "gpt-5.4-mini" | "gpt-5.3-codex-spark"
45- )
46- }
47-
4841fn subscription_resilience ( ) -> ResilienceConfig {
4942 ResilienceConfig {
5043 max_retries : usize:: MAX ,
@@ -66,8 +59,8 @@ pub struct SubscriptionConfig {
6659
6760impl SubscriptionConfig {
6861 pub fn new ( model : String ) -> Result < Self , String > {
69- if !supported_model ( & model) {
70- return Err ( "openai-subscription model is not in the supported model set " . into ( ) ) ;
62+ if !valid_model_id ( & model) {
63+ return Err ( "model name is outside canonical bounds " . into ( ) ) ;
7164 }
7265 Ok ( Self {
7366 model,
@@ -673,6 +666,12 @@ mod tests {
673666 use super :: * ;
674667 use serde_json:: json;
675668
669+ #[ test]
670+ fn subscription_config_accepts_models_without_a_client_release ( ) {
671+ assert ! ( SubscriptionConfig :: new( "gpt-future" . into( ) ) . is_ok( ) ) ;
672+ assert ! ( SubscriptionConfig :: new( "not a model" . into( ) ) . is_err( ) ) ;
673+ }
674+
676675 #[ test]
677676 fn subscription_caps_server_retry_hints_at_ten_minutes ( ) {
678677 let mut headers = HeaderMap :: new ( ) ;
You can’t perform that action at this time.
0 commit comments