mirror of
https://github.com/openai/codex.git
synced 2026-05-17 17:53:06 +00:00
Make file transfer tools non-experimental
Register upload_file and download_file as built-in tools instead of gating them on experimental_supported_tools, and add regression coverage for the ungated behavior. Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
@@ -2961,31 +2961,21 @@ pub(crate) fn build_specs_with_discoverable_tools(
|
||||
builder.register_handler("read_file", read_file_handler);
|
||||
}
|
||||
|
||||
if config
|
||||
.experimental_supported_tools
|
||||
.contains(&"upload_file".to_string())
|
||||
{
|
||||
push_tool_spec(
|
||||
&mut builder,
|
||||
create_upload_file_tool(),
|
||||
/*supports_parallel_tool_calls*/ true,
|
||||
config.code_mode_enabled,
|
||||
);
|
||||
builder.register_handler("upload_file", file_transfer_handler.clone());
|
||||
}
|
||||
push_tool_spec(
|
||||
&mut builder,
|
||||
create_upload_file_tool(),
|
||||
/*supports_parallel_tool_calls*/ true,
|
||||
config.code_mode_enabled,
|
||||
);
|
||||
builder.register_handler("upload_file", file_transfer_handler.clone());
|
||||
|
||||
if config
|
||||
.experimental_supported_tools
|
||||
.contains(&"download_file".to_string())
|
||||
{
|
||||
push_tool_spec(
|
||||
&mut builder,
|
||||
create_download_file_tool(),
|
||||
/*supports_parallel_tool_calls*/ true,
|
||||
config.code_mode_enabled,
|
||||
);
|
||||
builder.register_handler("download_file", file_transfer_handler);
|
||||
}
|
||||
push_tool_spec(
|
||||
&mut builder,
|
||||
create_download_file_tool(),
|
||||
/*supports_parallel_tool_calls*/ true,
|
||||
config.code_mode_enabled,
|
||||
);
|
||||
builder.register_handler("download_file", file_transfer_handler);
|
||||
|
||||
if config
|
||||
.experimental_supported_tools
|
||||
|
||||
@@ -1610,6 +1610,38 @@ fn test_models_json_default_model_includes_file_transfer_tools() {
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_file_transfer_tools_are_not_experimentally_gated() {
|
||||
let _config = test_config();
|
||||
let mut model_info = model_info_from_models_json("gpt-5-codex");
|
||||
model_info
|
||||
.experimental_supported_tools
|
||||
.retain(|tool| tool != "upload_file" && tool != "download_file");
|
||||
let features = Features::with_defaults();
|
||||
let available_models = Vec::new();
|
||||
let tools_config = ToolsConfig::new(&ToolsConfigParams {
|
||||
model_info: &model_info,
|
||||
available_models: &available_models,
|
||||
features: &features,
|
||||
web_search_mode: Some(WebSearchMode::Cached),
|
||||
session_source: SessionSource::Cli,
|
||||
sandbox_policy: &SandboxPolicy::DangerFullAccess,
|
||||
windows_sandbox_level: WindowsSandboxLevel::Disabled,
|
||||
});
|
||||
let (tools, _) = build_specs(&tools_config, None, None, &[]).build();
|
||||
|
||||
assert!(
|
||||
tools
|
||||
.iter()
|
||||
.any(|tool| tool_name(&tool.spec) == "upload_file")
|
||||
);
|
||||
assert!(
|
||||
tools
|
||||
.iter()
|
||||
.any(|tool| tool_name(&tool.spec) == "download_file")
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_build_specs_mcp_tools_converted() {
|
||||
let config = test_config();
|
||||
|
||||
Reference in New Issue
Block a user