Skip to main content

tool_executor_no_inner_defaults

Macro tool_executor_no_inner_defaults 

Source
macro_rules! tool_executor_no_inner_defaults {
    () => { ... };
}
Expand description

Emits the six risk-bearing ToolExecutor methods with the same trivial bodies the trait’s removed defaults used to provide: no confirmation required, confirmed execution falls back to execute_tool_call, checkpoints unsupported, not speculatable.

§Use ONLY on leaf executors that own no wrapped executor

Invoking this macro on a type that wraps another ToolExecutor (i.e. has an inner/delegate field) silently disables forwarding for all six methods and reintroduces issue #6019. Wrappers must use tool_executor_forward! for the mechanical four and hand-write requires_confirmation / execute_tool_call_confirmed. macro_rules! has no way to enforce this at compile time — review carefully.

§Examples

use zeph_tools::{ToolExecutor, ToolOutput, ToolError};

struct EchoExecutor;

impl ToolExecutor for EchoExecutor {
    async fn execute(&self, _response: &str) -> Result<Option<ToolOutput>, ToolError> {
        Ok(None)
    }

    zeph_tools::tool_executor_no_inner_defaults!();
}