@@ -461,8 +461,6 @@ pub const MODEL_OPTIONS: [ModelOption; 3] = [
461
461
} ,
462
462
] ;
463
463
464
- pub const DEFAULT_MODEL_ID : & str = "CLAUDE_SONNET_4_20250514_V1_0" ;
465
-
466
464
const GREETING_BREAK_POINT : usize = 80 ;
467
465
468
466
const POPULAR_SHORTCUTS : & str = color_print:: cstr! { "<black!><green!>/help</green!> all commands <em>•</em> <green!>ctrl + j</green!> new lines <em>•</em> <green!>ctrl + s</green!> fuzzy search</black!>" } ;
@@ -649,19 +647,19 @@ impl ChatContext {
649
647
let output_clone = output. clone ( ) ;
650
648
651
649
let mut existing_conversation = false ;
652
- let valid_model_id = match model_id {
653
- Some ( id ) => Some ( id ) ,
654
- None => database
655
- . settings
656
- . get_string ( Setting :: ChatDefaultModel )
657
- . and_then ( |model_name| {
658
- MODEL_OPTIONS
659
- . iter ( )
660
- . find ( |opt| opt. name == model_name)
661
- . map ( |opt| opt. model_id . to_owned ( ) )
662
- } )
663
- . or_else ( || Some ( DEFAULT_MODEL_ID . to_owned ( ) ) ) ,
664
- } ;
650
+ let valid_model_id = model_id
651
+ . or_else ( || {
652
+ database
653
+ . settings
654
+ . get_string ( Setting :: ChatDefaultModel )
655
+ . and_then ( |model_name| {
656
+ MODEL_OPTIONS
657
+ . iter ( )
658
+ . find ( |opt| opt. name == model_name)
659
+ . map ( |opt| opt. model_id . to_owned ( ) )
660
+ } )
661
+ } )
662
+ . unwrap_or_else ( || default_model_id ( database ) . to_owned ( ) ) ;
665
663
666
664
let conversation_state = if resume_conversation {
667
665
let prior = std:: env:: current_dir ( )
@@ -689,7 +687,7 @@ impl ChatContext {
689
687
profile,
690
688
Some ( output_clone) ,
691
689
tool_manager,
692
- valid_model_id,
690
+ Some ( valid_model_id) ,
693
691
)
694
692
. await
695
693
}
@@ -701,7 +699,7 @@ impl ChatContext {
701
699
profile,
702
700
Some ( output_clone) ,
703
701
tool_manager,
704
- valid_model_id,
702
+ Some ( valid_model_id) ,
705
703
)
706
704
. await
707
705
} ;
@@ -4244,6 +4242,14 @@ impl ChatContext {
4244
4242
}
4245
4243
}
4246
4244
4245
+ /// Currently, Sonnet 4 is set as the default model for non-FRA users.
4246
+ pub fn default_model_id ( database : & Database ) -> & ' static str {
4247
+ match database. get_auth_profile ( ) {
4248
+ Ok ( Some ( profile) ) if profile. arn . split ( ':' ) . nth ( 3 ) == Some ( "us-east-1" ) => "CLAUDE_SONNET_4_20250514_V1_0" ,
4249
+ _ => "CLAUDE_3_7_SONNET_20250219_V1_0" ,
4250
+ }
4251
+ }
4252
+
4247
4253
/// Display a spinner + text while waiting for an async function to finish.
4248
4254
async fn with_spinner < T , E , F , Fut > (
4249
4255
interactive : bool ,
0 commit comments