mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
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
This commit is contained in:
@@ -175,7 +175,6 @@ impl ToolsConfig {
|
||||
session_source,
|
||||
..
|
||||
} = params;
|
||||
let include_apply_patch_tool = features.enabled(Feature::ApplyPatchFreeform);
|
||||
let include_code_mode = features.enabled(Feature::CodeMode);
|
||||
let include_code_mode_only = include_code_mode && features.enabled(Feature::CodeModeOnly);
|
||||
let include_goal_tools = features.enabled(Feature::Goals);
|
||||
@@ -225,10 +224,7 @@ impl ToolsConfig {
|
||||
model_shell_type
|
||||
};
|
||||
|
||||
let apply_patch_tool_type = model_info
|
||||
.apply_patch_tool_type
|
||||
.clone()
|
||||
.or_else(|| include_apply_patch_tool.then_some(ApplyPatchToolType::Freeform));
|
||||
let apply_patch_tool_type = model_info.apply_patch_tool_type.clone();
|
||||
|
||||
let agent_jobs_worker_tools = include_agent_jobs
|
||||
&& matches!(
|
||||
|
||||
@@ -4,7 +4,6 @@ use codex_features::Features;
|
||||
use codex_protocol::config_types::WebSearchMode;
|
||||
use codex_protocol::config_types::WindowsSandboxLevel;
|
||||
use codex_protocol::models::PermissionProfile;
|
||||
use codex_protocol::openai_models::ApplyPatchToolType;
|
||||
use codex_protocol::openai_models::ConfigShellToolType;
|
||||
use codex_protocol::openai_models::InputModality;
|
||||
use codex_protocol::openai_models::ModelInfo;
|
||||
@@ -156,7 +155,7 @@ fn shell_zsh_fork_prefers_shell_command_over_unified_exec() {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn fallback_apply_patch_models_use_freeform_tool_by_default() {
|
||||
fn fallback_apply_patch_models_do_not_use_freeform_tool_by_default() {
|
||||
let model_info = model_info();
|
||||
let features = Features::with_defaults();
|
||||
|
||||
@@ -172,10 +171,7 @@ fn fallback_apply_patch_models_use_freeform_tool_by_default() {
|
||||
windows_sandbox_level: WindowsSandboxLevel::Disabled,
|
||||
});
|
||||
|
||||
assert_eq!(
|
||||
tools_config.apply_patch_tool_type,
|
||||
Some(ApplyPatchToolType::Freeform)
|
||||
);
|
||||
assert_eq!(tools_config.apply_patch_tool_type, None);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user