Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions codex-rs/core/src/tools/code_mode/execute_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,15 @@ impl ToolExecutor<ToolInvocation> for CodeModeExecuteHandler {
async fn handle(
&self,
invocation: ToolInvocation,
) -> Result<Box<dyn crate::tools::context::ToolOutput>, FunctionCallError> {
self.handle_call(invocation).await
}
}

impl CodeModeExecuteHandler {
async fn handle_call(
&self,
invocation: ToolInvocation,
) -> Result<Box<dyn crate::tools::context::ToolOutput>, FunctionCallError> {
let ToolInvocation {
session,
Expand Down
9 changes: 9 additions & 0 deletions codex-rs/core/src/tools/code_mode/wait_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,15 @@ impl ToolExecutor<ToolInvocation> for CodeModeWaitHandler {
async fn handle(
&self,
invocation: ToolInvocation,
) -> Result<Box<dyn crate::tools::context::ToolOutput>, FunctionCallError> {
self.handle_call(invocation).await
}
}

impl CodeModeWaitHandler {
async fn handle_call(
&self,
invocation: ToolInvocation,
) -> Result<Box<dyn crate::tools::context::ToolOutput>, FunctionCallError> {
let ToolInvocation {
session,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ impl ToolExecutor<ToolInvocation> for ReportAgentJobResultHandler {
async fn handle(
&self,
invocation: ToolInvocation,
) -> Result<Box<dyn crate::tools::context::ToolOutput>, FunctionCallError> {
self.handle_call(invocation).await
}
}

impl ReportAgentJobResultHandler {
async fn handle_call(
&self,
invocation: ToolInvocation,
) -> Result<Box<dyn crate::tools::context::ToolOutput>, FunctionCallError> {
let ToolInvocation {
session, payload, ..
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ impl ToolExecutor<ToolInvocation> for SpawnAgentsOnCsvHandler {
async fn handle(
&self,
invocation: ToolInvocation,
) -> Result<Box<dyn crate::tools::context::ToolOutput>, FunctionCallError> {
self.handle_call(invocation).await
}
}

impl SpawnAgentsOnCsvHandler {
async fn handle_call(
&self,
invocation: ToolInvocation,
) -> Result<Box<dyn crate::tools::context::ToolOutput>, FunctionCallError> {
let ToolInvocation {
session,
Expand Down
9 changes: 9 additions & 0 deletions codex-rs/core/src/tools/handlers/apply_patch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,15 @@ impl ToolExecutor<ToolInvocation> for ApplyPatchHandler {
async fn handle(
&self,
invocation: ToolInvocation,
) -> Result<Box<dyn crate::tools::context::ToolOutput>, FunctionCallError> {
self.handle_call(invocation).await
}
}

impl ApplyPatchHandler {
async fn handle_call(
&self,
invocation: ToolInvocation,
) -> Result<Box<dyn crate::tools::context::ToolOutput>, FunctionCallError> {
let ToolInvocation {
session,
Expand Down
9 changes: 9 additions & 0 deletions codex-rs/core/src/tools/handlers/dynamic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,15 @@ impl ToolExecutor<ToolInvocation> for DynamicToolHandler {
async fn handle(
&self,
invocation: ToolInvocation,
) -> Result<Box<dyn crate::tools::context::ToolOutput>, FunctionCallError> {
self.handle_call(invocation).await
}
}

impl DynamicToolHandler {
async fn handle_call(
&self,
invocation: ToolInvocation,
) -> Result<Box<dyn crate::tools::context::ToolOutput>, FunctionCallError> {
let ToolInvocation {
session,
Expand Down
18 changes: 18 additions & 0 deletions codex-rs/core/src/tools/handlers/extension_tools.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,15 @@ mod tests {
async fn handle(
&self,
call: codex_tools::ToolCall,
) -> Result<Box<dyn codex_tools::ToolOutput>, codex_tools::FunctionCallError> {
self.handle_call(call).await
}
}

impl CapturingExtensionExecutor {
async fn handle_call(
&self,
call: codex_tools::ToolCall,
) -> Result<Box<dyn codex_tools::ToolOutput>, codex_tools::FunctionCallError> {
let item = ExtensionTurnItem::WebSearch(WebSearchItem {
id: call.call_id.clone(),
Expand Down Expand Up @@ -452,6 +461,15 @@ mod tests {
async fn handle(
&self,
call: codex_tools::ToolCall,
) -> Result<Box<dyn codex_tools::ToolOutput>, codex_tools::FunctionCallError> {
self.handle_call(call).await
}
}

impl ImageGenerationExtensionExecutor {
async fn handle_call(
&self,
call: codex_tools::ToolCall,
) -> Result<Box<dyn codex_tools::ToolOutput>, codex_tools::FunctionCallError> {
call.turn_item_emitter
.emit_started(ExtensionTurnItem::ImageGeneration(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,15 @@ impl ToolExecutor<ToolInvocation> for ListAvailablePluginsToInstallHandler {
async fn handle(
&self,
invocation: ToolInvocation,
) -> Result<Box<dyn crate::tools::context::ToolOutput>, FunctionCallError> {
self.handle_call(invocation).await
}
}

impl ListAvailablePluginsToInstallHandler {
async fn handle_call(
&self,
invocation: ToolInvocation,
) -> Result<Box<dyn crate::tools::context::ToolOutput>, FunctionCallError> {
let ToolInvocation { payload, .. } = invocation;
match payload {
Expand Down
9 changes: 9 additions & 0 deletions codex-rs/core/src/tools/handlers/mcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,15 @@ impl ToolExecutor<ToolInvocation> for McpHandler {
async fn handle(
&self,
invocation: ToolInvocation,
) -> Result<Box<dyn crate::tools::context::ToolOutput>, FunctionCallError> {
self.handle_call(invocation).await
}
}

impl McpHandler {
async fn handle_call(
&self,
invocation: ToolInvocation,
) -> Result<Box<dyn crate::tools::context::ToolOutput>, FunctionCallError> {
let ToolInvocation {
session,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@ impl ToolExecutor<ToolInvocation> for ListMcpResourceTemplatesHandler {
async fn handle(
&self,
invocation: ToolInvocation,
) -> Result<Box<dyn crate::tools::context::ToolOutput>, FunctionCallError> {
self.handle_call(invocation).await
}
}

impl ListMcpResourceTemplatesHandler {
async fn handle_call(
&self,
invocation: ToolInvocation,
) -> Result<Box<dyn crate::tools::context::ToolOutput>, FunctionCallError> {
let ToolInvocation {
session,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@ impl ToolExecutor<ToolInvocation> for ListMcpResourcesHandler {
async fn handle(
&self,
invocation: ToolInvocation,
) -> Result<Box<dyn crate::tools::context::ToolOutput>, FunctionCallError> {
self.handle_call(invocation).await
}
}

impl ListMcpResourcesHandler {
async fn handle_call(
&self,
invocation: ToolInvocation,
) -> Result<Box<dyn crate::tools::context::ToolOutput>, FunctionCallError> {
let ToolInvocation {
session,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@ impl ToolExecutor<ToolInvocation> for ReadMcpResourceHandler {
async fn handle(
&self,
invocation: ToolInvocation,
) -> Result<Box<dyn crate::tools::context::ToolOutput>, FunctionCallError> {
self.handle_call(invocation).await
}
}

impl ReadMcpResourceHandler {
async fn handle_call(
&self,
invocation: ToolInvocation,
) -> Result<Box<dyn crate::tools::context::ToolOutput>, FunctionCallError> {
let ToolInvocation {
session,
Expand Down
9 changes: 9 additions & 0 deletions codex-rs/core/src/tools/handlers/multi_agents/send_input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ impl ToolExecutor<ToolInvocation> for Handler {
async fn handle(
&self,
invocation: ToolInvocation,
) -> Result<Box<dyn crate::tools::context::ToolOutput>, FunctionCallError> {
self.handle_call(invocation).await
}
}

impl Handler {
async fn handle_call(
&self,
invocation: ToolInvocation,
) -> Result<Box<dyn crate::tools::context::ToolOutput>, FunctionCallError> {
let ToolInvocation {
session,
Expand Down
9 changes: 9 additions & 0 deletions codex-rs/core/src/tools/handlers/multi_agents/wait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@ impl ToolExecutor<ToolInvocation> for Handler {
async fn handle(
&self,
invocation: ToolInvocation,
) -> Result<Box<dyn crate::tools::context::ToolOutput>, FunctionCallError> {
self.handle_call(invocation).await
}
}

impl Handler {
async fn handle_call(
&self,
invocation: ToolInvocation,
) -> Result<Box<dyn crate::tools::context::ToolOutput>, FunctionCallError> {
let ToolInvocation {
session,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ impl ToolExecutor<ToolInvocation> for Handler {
async fn handle(
&self,
invocation: ToolInvocation,
) -> Result<Box<dyn crate::tools::context::ToolOutput>, FunctionCallError> {
self.handle_call(invocation).await
}
}

impl Handler {
async fn handle_call(
&self,
invocation: ToolInvocation,
) -> Result<Box<dyn crate::tools::context::ToolOutput>, FunctionCallError> {
let arguments = function_arguments(invocation.payload.clone())?;
let args: FollowupTaskArgs = parse_arguments(&arguments)?;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ impl ToolExecutor<ToolInvocation> for Handler {
async fn handle(
&self,
invocation: ToolInvocation,
) -> Result<Box<dyn crate::tools::context::ToolOutput>, FunctionCallError> {
self.handle_call(invocation).await
}
}

impl Handler {
async fn handle_call(
&self,
invocation: ToolInvocation,
) -> Result<Box<dyn crate::tools::context::ToolOutput>, FunctionCallError> {
let ToolInvocation {
session,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ impl ToolExecutor<ToolInvocation> for Handler {
async fn handle(
&self,
invocation: ToolInvocation,
) -> Result<Box<dyn crate::tools::context::ToolOutput>, FunctionCallError> {
self.handle_call(invocation).await
}
}

impl Handler {
async fn handle_call(
&self,
invocation: ToolInvocation,
) -> Result<Box<dyn crate::tools::context::ToolOutput>, FunctionCallError> {
let arguments = function_arguments(invocation.payload.clone())?;
let args: SendMessageArgs = parse_arguments(&arguments)?;
Expand Down
9 changes: 9 additions & 0 deletions codex-rs/core/src/tools/handlers/multi_agents_v2/wait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ impl ToolExecutor<ToolInvocation> for Handler {
async fn handle(
&self,
invocation: ToolInvocation,
) -> Result<Box<dyn crate::tools::context::ToolOutput>, FunctionCallError> {
self.handle_call(invocation).await
}
}

impl Handler {
async fn handle_call(
&self,
invocation: ToolInvocation,
) -> Result<Box<dyn crate::tools::context::ToolOutput>, FunctionCallError> {
let ToolInvocation {
session,
Expand Down
9 changes: 9 additions & 0 deletions codex-rs/core/src/tools/handlers/plan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@ impl ToolExecutor<ToolInvocation> for PlanHandler {
async fn handle(
&self,
invocation: ToolInvocation,
) -> Result<Box<dyn crate::tools::context::ToolOutput>, FunctionCallError> {
self.handle_call(invocation).await
}
}

impl PlanHandler {
async fn handle_call(
&self,
invocation: ToolInvocation,
) -> Result<Box<dyn crate::tools::context::ToolOutput>, FunctionCallError> {
let ToolInvocation {
session,
Expand Down
9 changes: 9 additions & 0 deletions codex-rs/core/src/tools/handlers/request_permissions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@ impl ToolExecutor<ToolInvocation> for RequestPermissionsHandler {
async fn handle(
&self,
invocation: ToolInvocation,
) -> Result<Box<dyn crate::tools::context::ToolOutput>, FunctionCallError> {
self.handle_call(invocation).await
}
}

impl RequestPermissionsHandler {
async fn handle_call(
&self,
invocation: ToolInvocation,
) -> Result<Box<dyn crate::tools::context::ToolOutput>, FunctionCallError> {
let ToolInvocation {
session,
Expand Down
9 changes: 9 additions & 0 deletions codex-rs/core/src/tools/handlers/request_plugin_install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,15 @@ impl ToolExecutor<ToolInvocation> for RequestPluginInstallHandler {
async fn handle(
&self,
invocation: ToolInvocation,
) -> Result<Box<dyn crate::tools::context::ToolOutput>, FunctionCallError> {
self.handle_call(invocation).await
}
}

impl RequestPluginInstallHandler {
async fn handle_call(
&self,
invocation: ToolInvocation,
) -> Result<Box<dyn crate::tools::context::ToolOutput>, FunctionCallError> {
let ToolInvocation {
payload,
Expand Down
9 changes: 9 additions & 0 deletions codex-rs/core/src/tools/handlers/request_user_input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ impl ToolExecutor<ToolInvocation> for RequestUserInputHandler {
async fn handle(
&self,
invocation: ToolInvocation,
) -> Result<Box<dyn crate::tools::context::ToolOutput>, FunctionCallError> {
self.handle_call(invocation).await
}
}

impl RequestUserInputHandler {
async fn handle_call(
&self,
invocation: ToolInvocation,
) -> Result<Box<dyn crate::tools::context::ToolOutput>, FunctionCallError> {
let ToolInvocation {
session,
Expand Down
9 changes: 9 additions & 0 deletions codex-rs/core/src/tools/handlers/shell/shell_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,15 @@ impl ToolExecutor<ToolInvocation> for ShellCommandHandler {
async fn handle(
&self,
invocation: ToolInvocation,
) -> Result<Box<dyn crate::tools::context::ToolOutput>, FunctionCallError> {
self.handle_call(invocation).await
}
}

impl ShellCommandHandler {
async fn handle_call(
&self,
invocation: ToolInvocation,
) -> Result<Box<dyn crate::tools::context::ToolOutput>, FunctionCallError> {
let ToolInvocation {
session,
Expand Down
9 changes: 9 additions & 0 deletions codex-rs/core/src/tools/handlers/test_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,15 @@ impl ToolExecutor<ToolInvocation> for TestSyncHandler {
async fn handle(
&self,
invocation: ToolInvocation,
) -> Result<Box<dyn crate::tools::context::ToolOutput>, FunctionCallError> {
self.handle_call(invocation).await
}
}

impl TestSyncHandler {
async fn handle_call(
&self,
invocation: ToolInvocation,
) -> Result<Box<dyn crate::tools::context::ToolOutput>, FunctionCallError> {
let ToolInvocation { payload, .. } = invocation;

Expand Down
Loading
Loading