@@ -13,7 +13,6 @@ use crate::model_provider_info::built_in_model_providers;
13
13
use crate :: openai_model_info:: get_model_info;
14
14
use crate :: protocol:: AskForApproval ;
15
15
use crate :: protocol:: SandboxPolicy ;
16
- use crate :: spawn:: CODEX_ORIGINATOR_ENV_VAR ;
17
16
use codex_login:: AuthMode ;
18
17
use codex_protocol:: config_types:: ReasoningEffort ;
19
18
use codex_protocol:: config_types:: ReasoningSummary ;
@@ -36,6 +35,8 @@ pub(crate) const PROJECT_DOC_MAX_BYTES: usize = 32 * 1024; // 32 KiB
36
35
37
36
const CONFIG_TOML_FILE : & str = "config.toml" ;
38
37
38
+ const DEFAULT_RESPONSES_ORIGINATOR_HEADER : & str = "codex_cli_rs" ;
39
+
39
40
/// Application configuration loaded from disk and merged with overrides.
40
41
#[ derive( Debug , Clone , PartialEq ) ]
41
42
pub struct Config {
@@ -164,7 +165,7 @@ pub struct Config {
164
165
pub include_apply_patch_tool : bool ,
165
166
166
167
/// The value for the `originator` header included with Responses API requests.
167
- pub internal_originator : Option < String > ,
168
+ pub responses_originator_header : String ,
168
169
169
170
/// If set to `true`, the API key will be signed with the `originator` header.
170
171
pub preferred_auth_method : AuthMode ,
@@ -411,7 +412,7 @@ pub struct ConfigToml {
411
412
pub experimental_instructions_file : Option < PathBuf > ,
412
413
413
414
/// The value for the `originator` header included with Responses API requests.
414
- pub internal_originator : Option < String > ,
415
+ pub responses_originator_header_internal_override : Option < String > ,
415
416
416
417
pub projects : Option < HashMap < String , ProjectConfig > > ,
417
418
@@ -626,9 +627,9 @@ impl Config {
626
627
let include_apply_patch_tool_val =
627
628
include_apply_patch_tool. unwrap_or ( model_family. uses_apply_patch_tool ) ;
628
629
629
- let originator = std :: env :: var ( CODEX_ORIGINATOR_ENV_VAR )
630
- . ok ( )
631
- . or ( cfg . internal_originator ) ;
630
+ let responses_originator_header : String = cfg
631
+ . responses_originator_header_internal_override
632
+ . unwrap_or ( DEFAULT_RESPONSES_ORIGINATOR_HEADER . to_owned ( ) ) ;
632
633
633
634
let config = Self {
634
635
model,
@@ -683,7 +684,7 @@ impl Config {
683
684
experimental_resume,
684
685
include_plan_tool : include_plan_tool. unwrap_or ( false ) ,
685
686
include_apply_patch_tool : include_apply_patch_tool_val,
686
- internal_originator : originator ,
687
+ responses_originator_header ,
687
688
preferred_auth_method : cfg. preferred_auth_method . unwrap_or ( AuthMode :: ChatGPT ) ,
688
689
} ;
689
690
Ok ( config)
@@ -1048,7 +1049,7 @@ disable_response_storage = true
1048
1049
base_instructions: None ,
1049
1050
include_plan_tool: false ,
1050
1051
include_apply_patch_tool: false ,
1051
- internal_originator : None ,
1052
+ responses_originator_header : "codex_cli_rs" . to_string ( ) ,
1052
1053
preferred_auth_method: AuthMode :: ChatGPT ,
1053
1054
} ,
1054
1055
o3_profile_config
@@ -1101,7 +1102,7 @@ disable_response_storage = true
1101
1102
base_instructions : None ,
1102
1103
include_plan_tool : false ,
1103
1104
include_apply_patch_tool : false ,
1104
- internal_originator : None ,
1105
+ responses_originator_header : "codex_cli_rs" . to_string ( ) ,
1105
1106
preferred_auth_method : AuthMode :: ChatGPT ,
1106
1107
} ;
1107
1108
@@ -1169,7 +1170,7 @@ disable_response_storage = true
1169
1170
base_instructions : None ,
1170
1171
include_plan_tool : false ,
1171
1172
include_apply_patch_tool : false ,
1172
- internal_originator : None ,
1173
+ responses_originator_header : "codex_cli_rs" . to_string ( ) ,
1173
1174
preferred_auth_method : AuthMode :: ChatGPT ,
1174
1175
} ;
1175
1176
0 commit comments