@@ -130,6 +130,9 @@ pub struct Config {
130130 /// Base instructions override.
131131 pub base_instructions : Option < String > ,
132132
133+ /// Developer instructions override injected as a separate message.
134+ pub developer_instructions : Option < String > ,
135+
133136 /// Optional external notifier command. When set, Codex will spawn this
134137 /// program after each completed *turn* (i.e. when the agent finishes
135138 /// processing a user submission). The value must be the full command
@@ -869,8 +872,9 @@ pub struct ConfigToml {
869872 #[ serde( default ) ]
870873 pub notify : Option < Vec < String > > ,
871874
872- /// System instructions.
873- pub instructions : Option < String > ,
875+ /// Developer instructions inserted as a `developer` role message.
876+ #[ serde( default , alias = "instructions" ) ]
877+ pub developer_instructions : Option < String > ,
874878
875879 /// When set, restricts ChatGPT login to a specific workspace identifier.
876880 #[ serde( default ) ]
@@ -1155,6 +1159,7 @@ pub struct ConfigOverrides {
11551159 pub config_profile : Option < String > ,
11561160 pub codex_linux_sandbox_exe : Option < PathBuf > ,
11571161 pub base_instructions : Option < String > ,
1162+ pub developer_instructions : Option < String > ,
11581163 pub include_apply_patch_tool : Option < bool > ,
11591164 pub include_view_image_tool : Option < bool > ,
11601165 pub show_raw_agent_reasoning : Option < bool > ,
@@ -1185,6 +1190,7 @@ impl Config {
11851190 config_profile : config_profile_key,
11861191 codex_linux_sandbox_exe,
11871192 base_instructions,
1193+ developer_instructions,
11881194 include_apply_patch_tool : include_apply_patch_tool_override,
11891195 include_view_image_tool : include_view_image_tool_override,
11901196 show_raw_agent_reasoning,
@@ -1371,6 +1377,7 @@ impl Config {
13711377 let file_base_instructions =
13721378 Self :: get_base_instructions ( experimental_instructions_path, & resolved_cwd) ?;
13731379 let base_instructions = base_instructions. or ( file_base_instructions) ;
1380+ let developer_instructions = developer_instructions. or ( cfg. developer_instructions ) ;
13741381
13751382 // Default review model when not set in config; allow CLI override to take precedence.
13761383 let review_model = override_review_model
@@ -1395,6 +1402,7 @@ impl Config {
13951402 notify : cfg. notify ,
13961403 user_instructions,
13971404 base_instructions,
1405+ developer_instructions,
13981406 // The config.toml omits "_mode" because it's a config file. However, "_mode"
13991407 // is important in code to differentiate the mode from the store implementation.
14001408 cli_auth_credentials_store_mode : cfg. cli_auth_credentials_store . unwrap_or_default ( ) ,
@@ -3100,6 +3108,7 @@ model_verbosity = "high"
31003108 model_verbosity: None ,
31013109 chatgpt_base_url: "https://chatgpt.com/backend-api/" . to_string( ) ,
31023110 base_instructions: None ,
3111+ developer_instructions: None ,
31033112 forced_chatgpt_workspace_id: None ,
31043113 forced_login_method: None ,
31053114 include_apply_patch_tool: false ,
@@ -3171,6 +3180,7 @@ model_verbosity = "high"
31713180 model_verbosity : None ,
31723181 chatgpt_base_url : "https://chatgpt.com/backend-api/" . to_string ( ) ,
31733182 base_instructions : None ,
3183+ developer_instructions : None ,
31743184 forced_chatgpt_workspace_id : None ,
31753185 forced_login_method : None ,
31763186 include_apply_patch_tool : false ,
@@ -3257,6 +3267,7 @@ model_verbosity = "high"
32573267 model_verbosity : None ,
32583268 chatgpt_base_url : "https://chatgpt.com/backend-api/" . to_string ( ) ,
32593269 base_instructions : None ,
3270+ developer_instructions : None ,
32603271 forced_chatgpt_workspace_id : None ,
32613272 forced_login_method : None ,
32623273 include_apply_patch_tool : false ,
@@ -3329,6 +3340,7 @@ model_verbosity = "high"
33293340 model_verbosity : Some ( Verbosity :: High ) ,
33303341 chatgpt_base_url : "https://chatgpt.com/backend-api/" . to_string ( ) ,
33313342 base_instructions : None ,
3343+ developer_instructions : None ,
33323344 forced_chatgpt_workspace_id : None ,
33333345 forced_login_method : None ,
33343346 include_apply_patch_tool : false ,
0 commit comments