Skip to main content

Module executor_delegate

Module executor_delegate 

Source
Expand description

Boilerplate-reduction macros for ToolExecutor and ErasedToolExecutor implementors.

Issue #6019: both traits used to give the six risk-bearing methods (requires_confirmation, execute_tool_call_confirmed, the checkpoint trio, and is_tool_speculatable — plus their _erased counterparts) permissive default bodies. Wrapper types that forgot to override one silently inherited a default that could disable a security check, a checkpoint capability, or a confirmation gate. This recurred five times across prior PRs. The traits no longer provide those defaults — every implementor must now supply all six, and the compiler enforces it.

These four macros exist only to keep that compiler-forced boilerplate short. They do not themselves close the defect class — only the removal of the default bodies does that. A macro invoked on the wrong type (e.g. tool_executor_no_inner_defaults!() on a wrapper that owns an inner executor) silently reintroduces the exact bug this issue fixes, because macro_rules! cannot check “this type has no delegate field.” Read each macro’s own doc comment before using it.