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
3 changes: 0 additions & 3 deletions codex-rs/core/src/tools/code_mode/execute_handler.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use async_trait::async_trait;

use crate::function_tool::FunctionCallError;
use crate::tools::context::FunctionToolOutput;
use crate::tools::context::ToolInvocation;
Expand Down Expand Up @@ -53,7 +51,6 @@ impl CodeModeExecuteHandler {
}
}

#[async_trait]
impl ToolHandler for CodeModeExecuteHandler {
type Output = FunctionToolOutput;

Expand Down
2 changes: 0 additions & 2 deletions codex-rs/core/src/tools/code_mode/wait_handler.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use async_trait::async_trait;
use serde::Deserialize;

use crate::function_tool::FunctionCallError;
Expand Down Expand Up @@ -39,7 +38,6 @@ where
})
}

#[async_trait]
impl ToolHandler for CodeModeWaitHandler {
type Output = FunctionToolOutput;

Expand Down
2 changes: 0 additions & 2 deletions codex-rs/core/src/tools/handlers/agent_jobs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ use crate::tools::handlers::multi_agents::build_agent_spawn_config;
use crate::tools::handlers::parse_arguments;
use crate::tools::registry::ToolHandler;
use crate::tools::registry::ToolKind;
use async_trait::async_trait;
use codex_protocol::ThreadId;
use codex_protocol::protocol::AgentStatus;
use codex_protocol::protocol::SessionSource;
Expand Down Expand Up @@ -178,7 +177,6 @@ impl JobProgressEmitter {
}
}

#[async_trait]
impl ToolHandler for BatchJobHandler {
type Output = FunctionToolOutput;

Expand Down
2 changes: 0 additions & 2 deletions codex-rs/core/src/tools/handlers/apply_patch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ use crate::tools::registry::ToolKind;
use crate::tools::runtimes::apply_patch::ApplyPatchRequest;
use crate::tools::runtimes::apply_patch::ApplyPatchRuntime;
use crate::tools::sandboxing::ToolCtx;
use async_trait::async_trait;
use codex_apply_patch::ApplyPatchAction;
use codex_apply_patch::ApplyPatchFileChange;
use codex_protocol::models::FileSystemPermissions;
Expand Down Expand Up @@ -122,7 +121,6 @@ async fn effective_patch_permissions(
)
}

#[async_trait]
impl ToolHandler for ApplyPatchHandler {
type Output = ApplyPatchToolOutput;

Expand Down
2 changes: 0 additions & 2 deletions codex-rs/core/src/tools/handlers/dynamic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use crate::tools::context::ToolPayload;
use crate::tools::handlers::parse_arguments;
use crate::tools::registry::ToolHandler;
use crate::tools::registry::ToolKind;
use async_trait::async_trait;
use codex_protocol::dynamic_tools::DynamicToolCallRequest;
use codex_protocol::dynamic_tools::DynamicToolResponse;
use codex_protocol::models::FunctionCallOutputContentItem;
Expand All @@ -20,7 +19,6 @@ use tracing::warn;

pub struct DynamicToolHandler;

#[async_trait]
impl ToolHandler for DynamicToolHandler {
type Output = FunctionToolOutput;

Expand Down
3 changes: 0 additions & 3 deletions codex-rs/core/src/tools/handlers/js_repl.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use async_trait::async_trait;
use serde_json::Value as JsonValue;
use std::sync::Arc;
use std::time::Duration;
Expand Down Expand Up @@ -92,7 +91,6 @@ async fn emit_js_repl_exec_end(
};
emitter.emit(ctx, stage).await;
}
#[async_trait]
impl ToolHandler for JsReplHandler {
type Output = FunctionToolOutput;

Expand Down Expand Up @@ -182,7 +180,6 @@ impl ToolHandler for JsReplHandler {
}
}

#[async_trait]
impl ToolHandler for JsReplResetHandler {
type Output = FunctionToolOutput;

Expand Down
2 changes: 0 additions & 2 deletions codex-rs/core/src/tools/handlers/list_dir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use std::fs::FileType;
use std::path::Path;
use std::path::PathBuf;

use async_trait::async_trait;
use codex_utils_string::take_bytes_at_char_boundary;
use serde::Deserialize;
use tokio::fs;
Expand Down Expand Up @@ -45,7 +44,6 @@ struct ListDirArgs {
depth: usize,
}

#[async_trait]
impl ToolHandler for ListDirHandler {
type Output = FunctionToolOutput;

Expand Down
2 changes: 0 additions & 2 deletions codex-rs/core/src/tools/handlers/mcp.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use async_trait::async_trait;
use std::sync::Arc;

use crate::function_tool::FunctionCallError;
Expand All @@ -10,7 +9,6 @@ use crate::tools::registry::ToolKind;
use codex_protocol::mcp::CallToolResult;

pub struct McpHandler;
#[async_trait]
impl ToolHandler for McpHandler {
type Output = CallToolResult;

Expand Down
2 changes: 0 additions & 2 deletions codex-rs/core/src/tools/handlers/mcp_resource.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use std::sync::Arc;
use std::time::Duration;
use std::time::Instant;

use async_trait::async_trait;
use codex_protocol::mcp::CallToolResult;
use codex_protocol::models::function_call_output_content_items_to_text;
use rmcp::model::ListResourceTemplatesResult;
Expand Down Expand Up @@ -178,7 +177,6 @@ struct ReadResourcePayload {
result: ReadResourceResult,
}

#[async_trait]
impl ToolHandler for McpResourceHandler {
type Output = FunctionToolOutput;

Expand Down
1 change: 0 additions & 1 deletion codex-rs/core/src/tools/handlers/multi_agents.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ pub(crate) use crate::tools::handlers::multi_agents_common::*;
use crate::tools::handlers::parse_arguments;
use crate::tools::registry::ToolHandler;
use crate::tools::registry::ToolKind;
use async_trait::async_trait;
use codex_protocol::ThreadId;
use codex_protocol::models::ResponseInputItem;
use codex_protocol::openai_models::ReasoningEffort;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use super::*;

pub(crate) struct Handler;

#[async_trait]
impl ToolHandler for Handler {
type Output = CloseAgentResult;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use std::sync::Arc;

pub(crate) struct Handler;

#[async_trait]
impl ToolHandler for Handler {
type Output = ResumeAgentResult;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use crate::agent::control::render_input_preview;

pub(crate) struct Handler;

#[async_trait]
impl ToolHandler for Handler {
type Output = SendInputResult;

Expand Down
1 change: 0 additions & 1 deletion codex-rs/core/src/tools/handlers/multi_agents/spawn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ use crate::agent::next_thread_spawn_depth;

pub(crate) struct Handler;

#[async_trait]
impl ToolHandler for Handler {
type Output = SpawnAgentResult;

Expand Down
1 change: 0 additions & 1 deletion codex-rs/core/src/tools/handlers/multi_agents/wait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ use tokio::time::timeout_at;

pub(crate) struct Handler;

#[async_trait]
impl ToolHandler for Handler {
type Output = WaitAgentResult;

Expand Down
1 change: 0 additions & 1 deletion codex-rs/core/src/tools/handlers/multi_agents_v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ use crate::tools::handlers::multi_agents_common::*;
use crate::tools::handlers::parse_arguments;
use crate::tools::registry::ToolHandler;
use crate::tools::registry::ToolKind;
use async_trait::async_trait;
use codex_protocol::AgentPath;
use codex_protocol::models::ResponseInputItem;
use codex_protocol::openai_models::ReasoningEffort;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use super::*;

pub(crate) struct Handler;

#[async_trait]
impl ToolHandler for Handler {
type Output = CloseAgentResult;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ use super::*;

pub(crate) struct Handler;

#[async_trait]
impl ToolHandler for Handler {
type Output = MessageToolResult;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use crate::agent::control::ListedAgent;

pub(crate) struct Handler;

#[async_trait]
impl ToolHandler for Handler {
type Output = ListAgentsResult;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ use super::*;

pub(crate) struct Handler;

#[async_trait]
impl ToolHandler for Handler {
type Output = MessageToolResult;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ use codex_protocol::protocol::Op;

pub(crate) struct Handler;

#[async_trait]
impl ToolHandler for Handler {
type Output = SpawnAgentResult;

Expand Down
1 change: 0 additions & 1 deletion codex-rs/core/src/tools/handlers/multi_agents_v2/wait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ use tokio::time::timeout_at;

pub(crate) struct Handler;

#[async_trait]
impl ToolHandler for Handler {
type Output = WaitAgentResult;

Expand Down
2 changes: 0 additions & 2 deletions codex-rs/core/src/tools/handlers/plan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ use crate::tools::context::ToolOutput;
use crate::tools::context::ToolPayload;
use crate::tools::registry::ToolHandler;
use crate::tools::registry::ToolKind;
use async_trait::async_trait;
use codex_protocol::config_types::ModeKind;
use codex_protocol::models::FunctionCallOutputPayload;
use codex_protocol::models::ResponseInputItem;
Expand Down Expand Up @@ -44,7 +43,6 @@ impl ToolOutput for PlanToolOutput {
}
}

#[async_trait]
impl ToolHandler for PlanHandler {
type Output = PlanToolOutput;

Expand Down
2 changes: 0 additions & 2 deletions codex-rs/core/src/tools/handlers/request_permissions.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use async_trait::async_trait;
use codex_protocol::request_permissions::RequestPermissionsArgs;
use codex_sandboxing::policy_transforms::normalize_additional_permissions;

Expand All @@ -12,7 +11,6 @@ use crate::tools::registry::ToolKind;

pub struct RequestPermissionsHandler;

#[async_trait]
impl ToolHandler for RequestPermissionsHandler {
type Output = FunctionToolOutput;

Expand Down
2 changes: 0 additions & 2 deletions codex-rs/core/src/tools/handlers/request_user_input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use crate::tools::context::ToolPayload;
use crate::tools::handlers::parse_arguments;
use crate::tools::registry::ToolHandler;
use crate::tools::registry::ToolKind;
use async_trait::async_trait;
use codex_protocol::request_user_input::RequestUserInputArgs;
use codex_tools::REQUEST_USER_INPUT_TOOL_NAME;
use codex_tools::normalize_request_user_input_args;
Expand All @@ -15,7 +14,6 @@ pub struct RequestUserInputHandler {
pub default_mode_request_user_input: bool,
}

#[async_trait]
impl ToolHandler for RequestUserInputHandler {
type Output = FunctionToolOutput;

Expand Down
3 changes: 0 additions & 3 deletions codex-rs/core/src/tools/handlers/shell.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use async_trait::async_trait;
use codex_protocol::ThreadId;
use codex_protocol::models::ShellCommandToolCallParams;
use codex_protocol::models::ShellToolCallParams;
Expand Down Expand Up @@ -178,7 +177,6 @@ impl From<ShellCommandBackendConfig> for ShellCommandHandler {
}
}

#[async_trait]
impl ToolHandler for ShellHandler {
type Output = FunctionToolOutput;

Expand Down Expand Up @@ -279,7 +277,6 @@ impl ToolHandler for ShellHandler {
}
}

#[async_trait]
impl ToolHandler for ShellCommandHandler {
type Output = FunctionToolOutput;

Expand Down
2 changes: 0 additions & 2 deletions codex-rs/core/src/tools/handlers/test_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use std::sync::Arc;
use std::sync::OnceLock;
use std::time::Duration;

use async_trait::async_trait;
use serde::Deserialize;
use tokio::sync::Barrier;
use tokio::time::sleep;
Expand Down Expand Up @@ -54,7 +53,6 @@ fn barrier_map() -> &'static tokio::sync::Mutex<HashMap<String, BarrierState>> {
BARRIERS.get_or_init(|| tokio::sync::Mutex::new(HashMap::new()))
}

#[async_trait]
impl ToolHandler for TestSyncHandler {
type Output = FunctionToolOutput;

Expand Down
2 changes: 0 additions & 2 deletions codex-rs/core/src/tools/handlers/tool_search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use crate::tools::context::ToolPayload;
use crate::tools::context::ToolSearchOutput;
use crate::tools::registry::ToolHandler;
use crate::tools::registry::ToolKind;
use async_trait::async_trait;
use bm25::Document;
use bm25::Language;
use bm25::SearchEngineBuilder;
Expand All @@ -25,7 +24,6 @@ impl ToolSearchHandler {
}
}

#[async_trait]
impl ToolHandler for ToolSearchHandler {
type Output = ToolSearchOutput;

Expand Down
2 changes: 0 additions & 2 deletions codex-rs/core/src/tools/handlers/tool_suggest.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use std::collections::HashSet;

use async_trait::async_trait;
use codex_app_server_protocol::AppInfo;
use codex_mcp::mcp::CODEX_APPS_MCP_SERVER_NAME;
use codex_rmcp_client::ElicitationAction;
Expand Down Expand Up @@ -28,7 +27,6 @@ use crate::tools::registry::ToolKind;

pub struct ToolSuggestHandler;

#[async_trait]
impl ToolHandler for ToolSuggestHandler {
type Output = FunctionToolOutput;

Expand Down
2 changes: 0 additions & 2 deletions codex-rs/core/src/tools/handlers/unified_exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ use crate::unified_exec::ExecCommandRequest;
use crate::unified_exec::UnifiedExecContext;
use crate::unified_exec::UnifiedExecProcessManager;
use crate::unified_exec::WriteStdinRequest;
use async_trait::async_trait;
use codex_features::Feature;
use codex_otel::SessionTelemetry;
use codex_otel::metrics::names::TOOL_CALL_UNIFIED_EXEC_METRIC;
Expand Down Expand Up @@ -86,7 +85,6 @@ fn default_tty() -> bool {
false
}

#[async_trait]
impl ToolHandler for UnifiedExecHandler {
type Output = ExecCommandToolOutput;

Expand Down
2 changes: 0 additions & 2 deletions codex-rs/core/src/tools/handlers/view_image.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use async_trait::async_trait;
use codex_protocol::models::FunctionCallOutputBody;
use codex_protocol::models::FunctionCallOutputContentItem;
use codex_protocol::models::FunctionCallOutputPayload;
Expand Down Expand Up @@ -37,7 +36,6 @@ enum ViewImageDetail {
Original,
}

#[async_trait]
impl ToolHandler for ViewImageHandler {
type Output = ViewImageOutput;

Expand Down
Loading
Loading