Repository navigation
v0.5.0
What's New
Breaking Changes
AgentTool::execute()signature changed — The 4-parameter signature is replaced byexecute(params, ctx: ToolContext). All tool implementations must update.
New Features
-
ToolContextstruct — Bundlestool_call_id,tool_name,cancel,on_update, andon_progressinto a single parameter. Future-proofs the trait (adding fields is non-breaking). ImplementsCloneandDebug. -
ProgressMessageevent — Tools can emit lightweight user-facing progress text viactx.on_progress, surfaced asAgentEvent::ProgressMessage { tool_call_id, tool_name, text }. -
InputFiltertrait — Synchronousfilter(&self, text: &str) -> FilterResulthook applied before the LLM call:Pass— message goes through unchangedWarn(String)— warning appended to user message for the LLM to seeReject(String)— loop aborts immediately, emitsInputRejected { reason }event
-
InputRejectedevent — NewAgentEventvariant emitted when an input filter rejects a message. -
Sub-agent progress forwarding —
SubAgentToolnow forwardsProgressMessageevents from child agents via the parent'son_progresscallback.
Migration Guide
Update your AgentTool implementations:
// Before (v0.4):
async fn execute(
&self,
tool_call_id: &str,
params: Value,
cancel: CancellationToken,
on_update: Option<ToolUpdateFn>,
) -> Result<ToolResult, ToolError>
// After (v0.5):
async fn execute(
&self,
params: Value,
ctx: ToolContext,
) -> Result<ToolResult, ToolError>Access fields via ctx.cancel, ctx.on_update, ctx.tool_call_id, etc.