pub enum DispatchAction {
Proceed,
Patch(EffectKind),
Deny(ErrorReport),
}Expand description
Dispatch-boundary action.
Variants§
Proceed
Dispatch as is.
Patch(EffectKind)
Dispatch this effect instead. A patch must keep the family; the
stack rejects a family change as an internal error before later hooks
observe it. Tool calls must also retain their target name; only their
arguments may be patched. Completions must keep the tool choice, the
tool names, the raw tools and tool_choice parameters and the output
schema the turn was prepared with; definitions may be reordered or have
their descriptions and parameters rewritten, but for the parameters of
the output tool, which are the output schema. Change the turn’s tools through
AgentHook::on_completion_call and RequestPatch instead.
Deny(ErrorReport)
Do not dispatch: the effect resolves failed with this report and
never reaches a handler. For a tool call a report of kind
Cancelled cancels the run, one of kind Denied becomes a refused
result and any other kind the skipped result the model sees. For a
completion any report fails the turn.
Implementations§
Source§impl DispatchAction
impl DispatchAction
Sourcepub fn patch(kind: EffectKind) -> Self
pub fn patch(kind: EffectKind) -> Self
Dispatch this effect instead.
Sourcepub fn deny(report: ErrorReport) -> Self
pub fn deny(report: ErrorReport) -> Self
Deny with a report.
Sourcepub fn skip(reason: impl Into<String>) -> Self
pub fn skip(reason: impl Into<String>) -> Self
Deny a tool call so the model sees it as skipped with reason.
Sourcepub fn rewrite_tool_args(kind: &EffectKind, args: impl Into<Value>) -> Self
pub fn rewrite_tool_args(kind: &EffectKind, args: impl Into<Value>) -> Self
Patch a tool call’s arguments, keeping its name and context.
Proceed when kind is not a tool call.