From 898e5f82f08d0cba3ee8719c1e4ba83b38a38f60 Mon Sep 17 00:00:00 2001 From: jif-oai Date: Mon, 12 Jan 2026 17:40:52 +0000 Subject: [PATCH] nit: add docstring (#9099) Add docstring on `ToolHandler` trait --- codex-rs/core/src/tools/registry.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/codex-rs/core/src/tools/registry.rs b/codex-rs/core/src/tools/registry.rs index aa5442177..72b848e31 100644 --- a/codex-rs/core/src/tools/registry.rs +++ b/codex-rs/core/src/tools/registry.rs @@ -30,10 +30,16 @@ pub trait ToolHandler: Send + Sync { ) } + /// Returns `true` if the [ToolInvocation] *might* mutate the environment of the + /// user (through file system, OS operations, ...). + /// This function must remains defensive and return `true` if a doubt exist on the + /// exact effect of a ToolInvocation. async fn is_mutating(&self, _invocation: &ToolInvocation) -> bool { false } + /// Perform the actual [ToolInvocation] and returns a [ToolOutput] containing + /// the final output to return to the model. async fn handle(&self, invocation: ToolInvocation) -> Result; }