diff --git a/codex-rs/core/src/tools/handlers/file_transfer.rs b/codex-rs/core/src/tools/handlers/file_transfer.rs index 0500b27d35..eff15a0119 100644 --- a/codex-rs/core/src/tools/handlers/file_transfer.rs +++ b/codex-rs/core/src/tools/handlers/file_transfer.rs @@ -140,7 +140,7 @@ async fn handle_upload( http_status_code: None, path: Some(path.display().to_string()), }, - false, + /*success*/ false, ); } @@ -169,7 +169,7 @@ async fn handle_upload( http_status_code: None, path: Some(path.display().to_string()), }, - false, + /*success*/ false, ); } }; @@ -188,16 +188,16 @@ async fn handle_upload( http_status_code: None, path: Some(path.display().to_string()), }, - false, + /*success*/ false, ); } let auth = session.services.auth_manager.auth().await; let Some(auth) = auth else { - return json_output(&upload_auth_required(&path), false); + return json_output(&upload_auth_required(&path), /*success*/ false); }; if !auth.is_chatgpt_auth() { - return json_output(&upload_auth_required(&path), false); + return json_output(&upload_auth_required(&path), /*success*/ false); } let bearer_token = auth.get_token().map_err(|err| { FunctionCallError::RespondToModel(format!("failed to load chatgpt auth token: {err}")) @@ -265,7 +265,7 @@ async fn handle_download( retryable: Some(false), http_status_code: None, }, - false, + /*success*/ false, ); }; if !parent.exists() { @@ -286,7 +286,7 @@ async fn handle_download( retryable: Some(false), http_status_code: None, }, - false, + /*success*/ false, ); } } @@ -316,16 +316,22 @@ async fn handle_download( retryable: Some(false), http_status_code: None, }, - false, + /*success*/ false, ); } let auth = session.services.auth_manager.auth().await; let Some(auth) = auth else { - return json_output(&download_auth_required(&file_id, &path), false); + return json_output( + &download_auth_required(&file_id, &path), + /*success*/ false, + ); }; if !auth.is_chatgpt_auth() { - return json_output(&download_auth_required(&file_id, &path), false); + return json_output( + &download_auth_required(&file_id, &path), + /*success*/ false, + ); } let bearer_token = auth.get_token().map_err(|err| { FunctionCallError::RespondToModel(format!("failed to load chatgpt auth token: {err}")) @@ -410,14 +416,17 @@ async fn run_transfer( "file transfer helper could not run inside the sandbox".to_string(), ) }; - json_output_value(content, false) + json_output_value(content, /*success*/ false) } Err(crate::tools::sandboxing::ToolError::Rejected(message)) => { - json_output_value(transfer_internal_error(kind, &request, message), false) + json_output_value( + transfer_internal_error(kind, &request, message), + /*success*/ false, + ) } Err(crate::tools::sandboxing::ToolError::Codex(err)) => json_output_value( transfer_internal_error(kind, &request, err.to_string()), - false, + /*success*/ false, ), } } @@ -437,7 +446,7 @@ fn parse_helper_output( output.exit_code, output.stderr.text ), ), - false, + /*success*/ false, ); } let parsed: Value = serde_json::from_str(&output.stdout.text).map_err(|err| { diff --git a/codex-rs/core/src/tools/spec_tests.rs b/codex-rs/core/src/tools/spec_tests.rs index 8f2a144055..7661836744 100644 --- a/codex-rs/core/src/tools/spec_tests.rs +++ b/codex-rs/core/src/tools/spec_tests.rs @@ -455,6 +455,8 @@ fn test_full_toolset_specs_for_gpt5_codex_unified_exec_web_search() { PLAN_TOOL.clone(), create_request_user_input_tool(CollaborationModesConfig::default()), create_apply_patch_freeform_tool(), + create_upload_file_tool(), + create_download_file_tool(), ToolSpec::WebSearch { external_web_access: Some(true), filters: None, @@ -1191,6 +1193,8 @@ fn test_build_specs_gpt5_codex_default() { "update_plan", "request_user_input", "apply_patch", + "upload_file", + "download_file", "web_search", "view_image", "spawn_agent", @@ -1214,6 +1218,8 @@ fn test_build_specs_gpt51_codex_default() { "update_plan", "request_user_input", "apply_patch", + "upload_file", + "download_file", "web_search", "view_image", "spawn_agent", @@ -1239,6 +1245,8 @@ fn test_build_specs_gpt5_codex_unified_exec_web_search() { "update_plan", "request_user_input", "apply_patch", + "upload_file", + "download_file", "web_search", "view_image", "spawn_agent", @@ -1264,6 +1272,8 @@ fn test_build_specs_gpt51_codex_unified_exec_web_search() { "update_plan", "request_user_input", "apply_patch", + "upload_file", + "download_file", "web_search", "view_image", "spawn_agent", @@ -1287,6 +1297,8 @@ fn test_gpt_5_1_codex_max_defaults() { "update_plan", "request_user_input", "apply_patch", + "upload_file", + "download_file", "web_search", "view_image", "spawn_agent", @@ -1310,6 +1322,8 @@ fn test_codex_5_1_mini_defaults() { "update_plan", "request_user_input", "apply_patch", + "upload_file", + "download_file", "web_search", "view_image", "spawn_agent", @@ -1332,6 +1346,8 @@ fn test_gpt_5_defaults() { &[ "update_plan", "request_user_input", + "upload_file", + "download_file", "web_search", "view_image", "spawn_agent", @@ -1355,6 +1371,8 @@ fn test_gpt_5_1_defaults() { "update_plan", "request_user_input", "apply_patch", + "upload_file", + "download_file", "web_search", "view_image", "spawn_agent", @@ -1380,6 +1398,8 @@ fn test_gpt_5_1_codex_max_unified_exec_web_search() { "update_plan", "request_user_input", "apply_patch", + "upload_file", + "download_file", "web_search", "view_image", "spawn_agent", diff --git a/codex-rs/core/tests/suite/prompt_caching.rs b/codex-rs/core/tests/suite/prompt_caching.rs index 96b7f64570..7705b055e1 100644 --- a/codex-rs/core/tests/suite/prompt_caching.rs +++ b/codex-rs/core/tests/suite/prompt_caching.rs @@ -175,6 +175,8 @@ async fn prompt_tools_are_consistent_across_requests() -> anyhow::Result<()> { "update_plan", "request_user_input", "apply_patch", + "upload_file", + "download_file", "web_search", "view_image", "spawn_agent",