pub enum RecoveryPlan {
ContinueText {
assistant_prefix: String,
},
SynthesizeToolUse {
completed: Vec<ToolCall>,
cancelled_tool_hint: Option<InFlightTool>,
},
TruncateBeforeTool {
assistant_prefix: String,
cancelled_tool_id: String,
cancelled_tool_name: String,
},
WholeRestart,
}Expand description
Chosen recovery path for a mid-stream interruption. Computed from
InterruptSnapshot::plan.
Variants§
ContinueText
Only text accumulated. Retry the whole request with the accumulated text injected as an assistant prefix followed by a continuation prompt.
SynthesizeToolUse
At least one tool_use arrived intact. Synthesize a
StopReason::ToolUse terminal state so the loop runner executes the
completed tools. Any in-flight tool is surfaced as a hint for the
next user message.
TruncateBeforeTool
There was text plus a single unclosed tool_use. Truncate before the tool, emit a cancel event for consumers, then continue with the text prefix.
WholeRestart
Nothing salvageable: retry the entire request fresh.
Trait Implementations§
Source§impl Clone for RecoveryPlan
impl Clone for RecoveryPlan
Source§fn clone(&self) -> RecoveryPlan
fn clone(&self) -> RecoveryPlan
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RecoveryPlan
impl RefUnwindSafe for RecoveryPlan
impl Send for RecoveryPlan
impl Sync for RecoveryPlan
impl Unpin for RecoveryPlan
impl UnsafeUnpin for RecoveryPlan
impl UnwindSafe for RecoveryPlan
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more