chore(features) rm Feature::ApplyPatchFreeform (#22711) · openai/codex@51b0e94 · GitHub
Skip to content

Commit 51b0e94

Browse files
chore(features) rm Feature::ApplyPatchFreeform (#22711)
## Summary Removes the feature since this is effectively on by default in all cases where we should use it, or can be configured via models.json. ## Testing - [x] unit tests pass
1 parent 7c11c14 commit 51b0e94

28 files changed

Lines changed: 71 additions & 172 deletions

codex-rs/app-server/tests/suite/v2/turn_start.rs

Lines changed: 14 additions & 1 deletion

codex-rs/core/config.schema.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -457,9 +457,6 @@
457457
"in_app_browser": {
458458
"type": "boolean"
459459
},
460-
"include_apply_patch_tool": {
461-
"type": "boolean"
462-
},
463460
"js_repl": {
464461
"type": "boolean"
465462
},
@@ -4224,9 +4221,6 @@
42244221
"in_app_browser": {
42254222
"type": "boolean"
42264223
},
4227-
"include_apply_patch_tool": {
4228-
"type": "boolean"
4229-
},
42304224
"js_repl": {
42314225
"type": "boolean"
42324226
},

codex-rs/core/src/config/config_tests.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4320,7 +4320,6 @@ async fn feature_table_overrides_legacy_flags() -> std::io::Result<()> {
43204320
.await?;
43214321

43224322
assert!(!config.features.enabled(Feature::ApplyPatchFreeform));
4323-
assert!(!config.include_apply_patch_tool);
43244323

43254324
Ok(())
43264325
}
@@ -7505,7 +7504,6 @@ async fn test_precedence_fixture_with_o3_profile() -> std::io::Result<()> {
75057504
compact_prompt: None,
75067505
forced_chatgpt_workspace_id: None,
75077506
forced_login_method: None,
7508-
include_apply_patch_tool: true,
75097507
web_search_mode: Constrained::allow_any(WebSearchMode::Cached),
75107508
web_search_config: None,
75117509
use_experimental_unified_exec_tool: !cfg!(windows),
@@ -7954,7 +7952,6 @@ async fn test_precedence_fixture_with_gpt3_profile() -> std::io::Result<()> {
79547952
compact_prompt: None,
79557953
forced_chatgpt_workspace_id: None,
79567954
forced_login_method: None,
7957-
include_apply_patch_tool: true,
79587955
web_search_mode: Constrained::allow_any(WebSearchMode::Cached),
79597956
web_search_config: None,
79607957
use_experimental_unified_exec_tool: !cfg!(windows),
@@ -8117,7 +8114,6 @@ async fn test_precedence_fixture_with_zdr_profile() -> std::io::Result<()> {
81178114
compact_prompt: None,
81188115
forced_chatgpt_workspace_id: None,
81198116
forced_login_method: None,
8120-
include_apply_patch_tool: true,
81218117
web_search_mode: Constrained::allow_any(WebSearchMode::Cached),
81228118
web_search_config: None,
81238119
use_experimental_unified_exec_tool: !cfg!(windows),
@@ -8265,7 +8261,6 @@ async fn test_precedence_fixture_with_gpt5_profile() -> std::io::Result<()> {
82658261
compact_prompt: None,
82668262
forced_chatgpt_workspace_id: None,
82678263
forced_login_method: None,
8268-
include_apply_patch_tool: true,
82698264
web_search_mode: Constrained::allow_any(WebSearchMode::Cached),
82708265
web_search_config: None,
82718266
use_experimental_unified_exec_tool: !cfg!(windows),

codex-rs/core/src/config/managed_features.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,12 +348,10 @@ pub(crate) fn validate_feature_requirements_in_config_toml(
348348
let configured_features = Features::from_sources(
349349
FeatureConfigSource {
350350
features: cfg.features.as_ref(),
351-
include_apply_patch_tool: None,
352351
experimental_use_unified_exec_tool: cfg.experimental_use_unified_exec_tool,
353352
},
354353
FeatureConfigSource {
355354
features: profile.features.as_ref(),
356-
include_apply_patch_tool: None,
357355
experimental_use_unified_exec_tool: profile.experimental_use_unified_exec_tool,
358356
},
359357
FeatureOverrides::default(),

codex-rs/core/src/config/mod.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -764,11 +764,6 @@ pub struct Config {
764764
/// When set, restricts the login mechanism users may use.
765765
pub forced_login_method: Option<ForcedLoginMethod>,
766766

767-
/// Include the `apply_patch` tool for models that benefit from invoking
768-
/// file edits as a structured tool call. When unset, this falls back to the
769-
/// model info's default preference.
770-
pub include_apply_patch_tool: bool,
771-
772767
/// Explicit or feature-derived web search mode.
773768
pub web_search_mode: Constrained<WebSearchMode>,
774769

@@ -2301,12 +2296,10 @@ impl Config {
23012296
let configured_features = Features::from_sources(
23022297
FeatureConfigSource {
23032298
features: cfg.features.as_ref(),
2304-
include_apply_patch_tool: None,
23052299
experimental_use_unified_exec_tool: cfg.experimental_use_unified_exec_tool,
23062300
},
23072301
FeatureConfigSource {
23082302
features: config_profile.features.as_ref(),
2309-
include_apply_patch_tool: None,
23102303
experimental_use_unified_exec_tool: config_profile
23112304
.experimental_use_unified_exec_tool,
23122305
},
@@ -2845,7 +2838,6 @@ impl Config {
28452838
config
28462839
};
28472840

2848-
let include_apply_patch_tool_flag = features.enabled(Feature::ApplyPatchFreeform);
28492841
let use_experimental_unified_exec_tool = features.enabled(Feature::UnifiedExec);
28502842

28512843
let forced_chatgpt_workspace_id = cfg
@@ -3257,7 +3249,6 @@ impl Config {
32573249
experimental_thread_store: thread_store_config(cfg.experimental_thread_store),
32583250
forced_chatgpt_workspace_id,
32593251
forced_login_method,
3260-
include_apply_patch_tool: include_apply_patch_tool_flag,
32613252
web_search_mode: constrained_web_search_mode.value,
32623253
web_search_config,
32633254
use_experimental_unified_exec_tool,

codex-rs/core/src/guardian/review_session.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@ struct GuardianReviewSessionReuseKey {
151151
main_execve_wrapper_exe: Option<PathBuf>,
152152
zsh_path: Option<PathBuf>,
153153
features: ManagedFeatures,
154-
include_apply_patch_tool: bool,
155154
use_experimental_unified_exec_tool: bool,
156155
}
157156

@@ -176,7 +175,6 @@ impl GuardianReviewSessionReuseKey {
176175
main_execve_wrapper_exe: spawn_config.main_execve_wrapper_exe.clone(),
177176
zsh_path: spawn_config.zsh_path.clone(),
178177
features: spawn_config.features.clone(),
179-
include_apply_patch_tool: spawn_config.include_apply_patch_tool,
180178
use_experimental_unified_exec_tool: spawn_config.use_experimental_unified_exec_tool,
181179
}
182180
}

codex-rs/core/src/tools/spec_tests.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1162,7 +1162,6 @@ async fn test_mcp_tool_array_without_items_gets_default_string_items() {
11621162
let model_info = construct_model_info_offline("gpt-5.4", &config);
11631163
let mut features = Features::with_defaults();
11641164
features.enable(Feature::UnifiedExec);
1165-
features.enable(Feature::ApplyPatchFreeform);
11661165
let available_models = Vec::new();
11671166
let tools_config = ToolsConfig::new(&ToolsConfigParams {
11681167
model_info: &model_info,

codex-rs/core/tests/common/test_codex.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ use codex_exec_server::CreateDirectoryOptions;
2424
use codex_exec_server::ExecutorFileSystem;
2525
use codex_exec_server::RemoveOptions;
2626
use codex_extension_api::empty_extension_registry;
27-
use codex_features::Feature;
2827
use codex_login::CodexAuth;
2928
use codex_model_provider_info::ModelProviderInfo;
3029
use codex_model_provider_info::built_in_model_providers;
@@ -581,12 +580,6 @@ impl TestCodexBuilder {
581580
}
582581
ensure_test_model_catalog(&mut config)?;
583582

584-
if config.include_apply_patch_tool {
585-
config.features.enable(Feature::ApplyPatchFreeform)?;
586-
} else {
587-
config.features.disable(Feature::ApplyPatchFreeform)?;
588-
}
589-
590583
Ok((config, cwd))
591584
}
592585
}

codex-rs/core/tests/suite/apply_patch_cli.rs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,7 @@ pub async fn apply_patch_harness() -> Result<TestCodexHarness> {
5959
async fn apply_patch_harness_with(
6060
configure: impl FnOnce(TestCodexBuilder) -> TestCodexBuilder,
6161
) -> Result<TestCodexHarness> {
62-
let builder = configure(test_codex()).with_config(|config| {
63-
config.include_apply_patch_tool = true;
64-
});
62+
let builder = configure(test_codex());
6563
// Box harness construction so apply_patch_cli tests do not inline the
6664
// full test-thread startup path into each test future.
6765
Box::pin(TestCodexHarness::with_remote_env_builder(builder)).await
@@ -989,15 +987,7 @@ async fn apply_patch_cli_verification_failure_has_no_side_effects(
989987
) -> Result<()> {
990988
skip_if_no_network!(Ok(()));
991989

992-
let harness = apply_patch_harness_with(|builder| {
993-
builder.with_config(|config| {
994-
config
995-
.features
996-
.enable(Feature::ApplyPatchFreeform)
997-
.expect("test config should allow feature update");
998-
})
999-
})
1000-
.await?;
990+
let harness = apply_patch_harness().await?;
1001991

1002992
// Compose a patch that would create a file, then fail verification on an update.
1003993
let call_id = "apply-partial-no-side-effects";

codex-rs/core/tests/suite/approvals.rs

Lines changed: 1 addition & 1 deletion

0 commit comments

Comments
 (0)