@@ -6,7 +6,7 @@ use derive_setters::Setters;
66use serde:: { Deserialize , Serialize } ;
77use url:: Url ;
88
9- use crate :: { HttpConfig , RetryConfig } ;
9+ use crate :: { HttpConfig , ModelId , ProviderId , RetryConfig } ;
1010
1111const VERSION : & str = match option_env ! ( "APP_VERSION" ) {
1212 Some ( val) => val,
@@ -70,6 +70,15 @@ pub struct Environment {
7070 /// Maximum number of conversations to show in list.
7171 /// Controlled by FORGE_MAX_CONVERSATIONS environment variable.
7272 pub max_conversations : usize ,
73+ /// Override model for all providers from FORGE_OVERRIDE_MODEL environment
74+ /// variable. If set, this model will be used instead of configured
75+ /// models.
76+ #[ dummy( default ) ]
77+ pub override_model : Option < ModelId > ,
78+ /// Override provider from FORGE_OVERRIDE_PROVIDER environment variable.
79+ /// If set, this provider will be used as default.
80+ #[ dummy( default ) ]
81+ pub override_provider : Option < ProviderId > ,
7382}
7483
7584impl Environment {
@@ -273,6 +282,8 @@ fn test_command_path() {
273282 custom_history_path : None ,
274283 max_conversations : 100 ,
275284 max_image_size : 262144 ,
285+ override_model : None ,
286+ override_provider : None ,
276287 } ;
277288
278289 let actual = fixture. command_path ( ) ;
@@ -307,6 +318,8 @@ fn test_command_cwd_path() {
307318 custom_history_path : None ,
308319 max_conversations : 100 ,
309320 max_image_size : 262144 ,
321+ override_model : None ,
322+ override_provider : None ,
310323 } ;
311324
312325 let actual = fixture. command_cwd_path ( ) ;
@@ -341,6 +354,8 @@ fn test_command_cwd_path_independent_from_command_path() {
341354 custom_history_path : None ,
342355 max_conversations : 100 ,
343356 max_image_size : 262144 ,
357+ override_model : None ,
358+ override_provider : None ,
344359 } ;
345360
346361 let command_path = fixture. command_path ( ) ;
0 commit comments