pub struct CallScope<'a> {
pub approver: &'a dyn Approver,
pub run: &'a RunScope,
pub registry: &'a ToolRegistry,
pub call_id: Option<&'a str>,
}Expand description
The run a single tool call belongs to, the approver that call’s policy was put to, and the registry the call arrived through.
The registry is here for tool_call, which is a router: it has to dispatch the tool it was
given through this funnel, so that a deferred tool faces the same policy check, the same
approval prompt and the same hooks as a call the model made directly. Handing the reference
down from dispatch_scoped costs nothing and is honest about it — the alternative is a
registry that owns a tool holding an Arc back to the registry, which is a reference cycle
in the one place a mistake would leak every plugin.
Fields§
§approver: &'a dyn Approver§run: &'a RunScope§registry: &'a ToolRegistry§call_id: Option<&'a str>The id of the call this one belongs to, when it belongs to one (#369). tool_call is a
funnel: the call it re-dispatches is the call the answer is about, so the id travels with
it — a nested row is then matchable by approvals::decision_for on resume, which otherwise
looks for "" and finds nothing. A tool that makes a call of its own leaves this None.