@@ -131,7 +131,6 @@ pub(crate) const TOML_KEY_MAP: &[(&str, &str)] = &[
131131 ( "gemini_args" , "launch.gemini.args" ) ,
132132 ( "gemini_system_prompt" , "launch.gemini.system_prompt" ) ,
133133 ( "codex_args" , "launch.codex.args" ) ,
134- ( "codex_sandbox_mode" , "launch.codex.sandbox_mode" ) ,
135134 ( "codex_system_prompt" , "launch.codex.system_prompt" ) ,
136135 ( "opencode_args" , "launch.opencode.args" ) ,
137136 ( "kilo_args" , "launch.kilo.args" ) ,
@@ -172,7 +171,6 @@ const FIELD_TO_ENV: &[(&str, &str)] = &[
172171 ( "claude_args" , "HCOM_CLAUDE_ARGS" ) ,
173172 ( "gemini_args" , "HCOM_GEMINI_ARGS" ) ,
174173 ( "codex_args" , "HCOM_CODEX_ARGS" ) ,
175- ( "codex_sandbox_mode" , "HCOM_CODEX_SANDBOX_MODE" ) ,
176174 ( "gemini_system_prompt" , "HCOM_GEMINI_SYSTEM_PROMPT" ) ,
177175 ( "codex_system_prompt" , "HCOM_CODEX_SYSTEM_PROMPT" ) ,
178176 ( "opencode_args" , "HCOM_OPENCODE_ARGS" ) ,
@@ -214,9 +212,6 @@ const TERMINAL_DANGEROUS_CHARS: &[char] = &['`', '$', ';', '|', '&', '\n', '\r']
214212
215213use crate :: shared:: terminal_presets:: TERMINAL_PRESETS ;
216214
217- /// Valid codex sandbox modes.
218- pub const VALID_SANDBOX_MODES : & [ & str ] = & [ "workspace" , "danger-full-access" , "none" ] ;
219-
220215/// TOML file header comment.
221216const TOML_HEADER : & str = "\
222217 # hcom configuration
@@ -298,7 +293,6 @@ pub struct HcomConfig {
298293 pub kimi_args : String ,
299294 pub copilot_args : String ,
300295 pub grok_args : String ,
301- pub codex_sandbox_mode : String ,
302296 pub gemini_system_prompt : String ,
303297 pub codex_system_prompt : String ,
304298 pub relay : String ,
@@ -337,7 +331,6 @@ impl Default for HcomConfig {
337331 kimi_args : String :: new ( ) ,
338332 copilot_args : String :: new ( ) ,
339333 grok_args : String :: new ( ) ,
340- codex_sandbox_mode : "workspace" . to_string ( ) ,
341334 gemini_system_prompt : String :: new ( ) ,
342335 codex_system_prompt : String :: new ( ) ,
343336 relay : String :: new ( ) ,
@@ -469,17 +462,6 @@ impl HcomConfig {
469462 }
470463 }
471464
472- // Validate codex_sandbox_mode
473- if !VALID_SANDBOX_MODES . contains ( & self . codex_sandbox_mode . as_str ( ) ) {
474- errors. insert (
475- "codex_sandbox_mode" . into ( ) ,
476- format ! (
477- "codex_sandbox_mode must be one of {:?}, got '{}'" ,
478- VALID_SANDBOX_MODES , self . codex_sandbox_mode
479- ) ,
480- ) ;
481- }
482-
483465 // Validate auto_subscribe (comma-separated alphanumeric/underscore preset names)
484466 if !self . auto_subscribe . is_empty ( ) {
485467 for preset in self . auto_subscribe . split ( ',' ) {
@@ -523,7 +505,6 @@ impl HcomConfig {
523505 "kimi_args" => Some ( self . kimi_args . clone ( ) ) ,
524506 "copilot_args" => Some ( self . copilot_args . clone ( ) ) ,
525507 "grok_args" => Some ( self . grok_args . clone ( ) ) ,
526- "codex_sandbox_mode" => Some ( self . codex_sandbox_mode . clone ( ) ) ,
527508 "gemini_system_prompt" => Some ( self . gemini_system_prompt . clone ( ) ) ,
528509 "codex_system_prompt" => Some ( self . codex_system_prompt . clone ( ) ) ,
529510 "relay" => Some ( self . relay . clone ( ) ) ,
@@ -570,16 +551,6 @@ impl HcomConfig {
570551 "kimi_args" => self . kimi_args = value. to_string ( ) ,
571552 "copilot_args" => self . copilot_args = value. to_string ( ) ,
572553 "grok_args" => self . grok_args = value. to_string ( ) ,
573- "codex_sandbox_mode" => {
574- // Retired modes fall back to the default rather than turning an
575- // existing config into an error. `untrusted` relied on Codex's
576- // `-a untrusted`, which Codex 0.152 removed.
577- self . codex_sandbox_mode = if matches ! ( value, "full-auto" | "untrusted" ) {
578- "workspace" . to_string ( )
579- } else {
580- value. to_string ( )
581- } ;
582- }
583554 "gemini_system_prompt" => self . gemini_system_prompt = value. to_string ( ) ,
584555 "codex_system_prompt" => self . codex_system_prompt = value. to_string ( ) ,
585556 "relay" => self . relay = value. to_string ( ) ,
@@ -704,7 +675,6 @@ impl HcomConfig {
704675 "cursor_args" ,
705676 "copilot_args" ,
706677 "grok_args" ,
707- "codex_sandbox_mode" ,
708678 "gemini_system_prompt" ,
709679 "codex_system_prompt" ,
710680 "auto_subscribe" ,
@@ -714,9 +684,8 @@ impl HcomConfig {
714684 for str_field in & str_fields {
715685 if let Some ( val) = get_var ( str_field) {
716686 let s = val. as_string ( ) ;
717- // terminal and codex_sandbox_mode: skip empty (use default)
718- if ( * str_field == "terminal" || * str_field == "codex_sandbox_mode" ) && s. is_empty ( )
719- {
687+ // Empty terminal uses the default.
688+ if * str_field == "terminal" && s. is_empty ( ) {
720689 continue ;
721690 }
722691 let _ = config. set_field ( str_field, & s) ;
@@ -1864,7 +1833,6 @@ mod tests {
18641833 assert_eq ! ( config. subagent_timeout, 30 ) ;
18651834 assert_eq ! ( config. terminal, "default" ) ;
18661835 assert_eq ! ( config. tag, "" ) ;
1867- assert_eq ! ( config. codex_sandbox_mode, "workspace" ) ;
18681836 assert ! ( config. relay_enabled) ;
18691837 assert ! ( config. auto_approve) ;
18701838 assert_eq ! ( config. auto_subscribe, "collision" ) ;
@@ -1904,22 +1872,6 @@ mod tests {
19041872 assert ! ( !config. collect_errors( ) . contains_key( "tag" ) ) ;
19051873 }
19061874
1907- #[ test]
1908- fn test_hcom_config_validation_sandbox_mode ( ) {
1909- let mut config = HcomConfig :: default ( ) ;
1910-
1911- for mode in VALID_SANDBOX_MODES {
1912- config. codex_sandbox_mode = mode. to_string ( ) ;
1913- assert ! (
1914- !config. collect_errors( ) . contains_key( "codex_sandbox_mode" ) ,
1915- "mode '{mode}' should be valid"
1916- ) ;
1917- }
1918-
1919- config. codex_sandbox_mode = "invalid" . to_string ( ) ;
1920- assert ! ( config. collect_errors( ) . contains_key( "codex_sandbox_mode" ) ) ;
1921- }
1922-
19231875 #[ test]
19241876 fn test_hcom_config_validation_shell_args ( ) {
19251877 let mut config = HcomConfig {
@@ -2023,15 +1975,6 @@ mod tests {
20231975 assert ! ( config. collect_errors( ) . contains_key( "terminal" ) ) ;
20241976 }
20251977
2026- #[ test]
2027- fn test_set_field_retired_sandbox_modes_normalize_to_workspace ( ) {
2028- for retired in [ "full-auto" , "untrusted" ] {
2029- let mut config = HcomConfig :: default ( ) ;
2030- config. set_field ( "codex_sandbox_mode" , retired) . unwrap ( ) ;
2031- assert_eq ! ( config. codex_sandbox_mode, "workspace" , "{retired}" ) ;
2032- }
2033- }
2034-
20351978 #[ test]
20361979 fn test_set_field_bool_coercion ( ) {
20371980 let mut config = HcomConfig :: default ( ) ;
@@ -2205,19 +2148,6 @@ mod tests {
22052148 assert ! ( !config. auto_approve) ;
22062149 }
22072150
2208- #[ test]
2209- fn test_load_from_sources_sandbox_mode_empty_uses_default ( ) {
2210- let mut file_config = HashMap :: new ( ) ;
2211- file_config. insert (
2212- "codex_sandbox_mode" . to_string ( ) ,
2213- TomlFieldValue :: Str ( "" . to_string ( ) ) ,
2214- ) ;
2215-
2216- let env = HashMap :: new ( ) ;
2217- let config = HcomConfig :: load_from_sources ( & file_config, Some ( & env) ) . unwrap ( ) ;
2218- assert_eq ! ( config. codex_sandbox_mode, "workspace" ) ; // Default, not empty
2219- }
2220-
22212151 #[ test]
22222152 fn test_load_from_sources_terminal_empty_uses_default ( ) {
22232153 let mut file_config = HashMap :: new ( ) ;
@@ -2403,16 +2333,6 @@ auto_approve = false
24032333 ) ;
24042334 }
24052335
2406- #[ test]
2407- fn test_hcom_config_from_env_dict_with_retired_sandbox_modes ( ) {
2408- for retired in [ "full-auto" , "untrusted" ] {
2409- let mut data = HcomConfig :: default ( ) . to_env_dict ( ) ;
2410- data. insert ( "HCOM_CODEX_SANDBOX_MODE" . to_string ( ) , retired. to_string ( ) ) ;
2411- let config = HcomConfig :: from_env_dict ( & data) . unwrap ( ) ;
2412- assert_eq ! ( config. codex_sandbox_mode, "workspace" , "{retired}" ) ;
2413- }
2414- }
2415-
24162336 #[ test]
24172337 fn test_hcom_config_validation_error_display ( ) {
24182338 let errors = HashMap :: from ( [
0 commit comments