Skip to content

armgit / codex

Public Imported from GitHub
0

Lightweight coding agent that runs in your terminal

Rust

nit: add docstring (#9099)

jif-oai898e5f82f08d
diff --git a/codex-rs/core/src/tools/registry.rs b/codex-rs/core/src/tools/registry.rs
index aa54421770..72b848e315 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<ToolOutput, FunctionCallError>;
}