pub struct RunTurnOptions {
pub approved_call_ids: HashSet<(String, String, String)>,
pub denied_call_ids: HashSet<(String, String, String)>,
pub stream_tx: Option<UnboundedSender<TurnStreamEvent>>,
pub web_search: bool,
}Expand description
Options for a single run_turn invocation.
A small builder-style struct rather than a long parameter list — keeps the
hot-path call sites readable (RunTurnOptions::default()) and gives the
HITL-resume path a typed slot for the approved-call-ids set without adding
a third positional HashSet argument every existing caller would have to
thread through.
Fields§
§approved_call_ids: HashSet<(String, String, String)>Provider-assigned tool-call ids the caller has previously gathered
signed HITL approvals for. When ToolExecutor::needs_approval
returns true for a tool call, the loop checks this set: if the
call’s id is present, the tool executes as normal; if absent, the
loop pauses with a fresh PendingApproval as today.
Used by the control plane → harness resume cycle: the control plane
replays the conversation’s event log, collects every verified
approval_response that isn’t yet answered by a matching tool_result
message in the transcript, and passes the set here so the harness
re-drives the function-calling loop with the previously-paused tools
executed.
Each entry is the signed (request_id, tool_name, args_json) tuple — the
approval is bound to that exact call (#141), so a re-emitted same-id call
with different args/tool does NOT inherit the approval (it re-pauses).
denied_call_ids: HashSet<(String, String, String)>Verified signed HITL denials as (request_id, tool_name, args_json)
tuples (a verified approval_response with approved == false).
A denial must RESOLVE the call, not leave it pending: when
ToolExecutor::needs_approval returns true for a call whose
(id, name, args) tuple is in this set, the loop emits a synthetic denial
tool_result (carrying {"approved":false,"error":"denied by human approver"}) WITHOUT executing the tool and WITHOUT re-pausing. As with
approvals the denial is bound to the exact call — the same id with
different args is a new request, not an inherited denial.
A call needing approval that is in neither Self::approved_call_ids
nor this set still pends as before.
stream_tx: Option<UnboundedSender<TurnStreamEvent>>When set, the turn loop forwards each TurnStreamEvent (text delta,
tool start) as it arrives, so a caller can stream partial output
mid-turn (the harness forwards these over its bidi stream → control
plane → Slack chat.appendStream). None keeps the buffered path:
the full TurnResult is always returned regardless.
web_search: boolWhen true, each request this turn sets CompletionRequest::web_search
so the provider offers the model public-web grounding (Vertex Gemini maps
it to the googleSearch tool). Only the answering loop sets this; the
summarizer and classifier build their own requests and never enable it.
Trait Implementations§
Source§impl Clone for RunTurnOptions
impl Clone for RunTurnOptions
Source§fn clone(&self) -> RunTurnOptions
fn clone(&self) -> RunTurnOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more