pub enum CancelReply {
Stopped,
StillCancelling {
detail: String,
},
Failed {
error: String,
},
}Expand description
What a backend actually confirmed about a dispatched cancel (#8207).
Why: a cooperative cancel has three outcomes, not two, and the TUI renders
each differently. “The run stopped” ends the turn and reopens input; “the
cancel was accepted but the run has not stopped yet” must keep the
cancelling state on screen, because reopening input there is exactly how
the next prompt earned a -32003 already has a task running refusal from
the daemon (#8207’s transcript); “the cancel could not be delivered at all”
is a failure and must never read as either of the first two.
What: produced by crate::engine::TuiEngine::cancel_session_reply and
carried to the reducer as
crate::event::ReplEvent::CancelSettled. Every payload string here is
rendered VERBATIM into the scrollback, so an implementor owes a plain
sentence — never a protocol code or a JSON-RPC envelope.
Test: crate::app::reduce::tests::apply_cancel_settled_stopped_reopens_input
and its siblings.
Variants§
Stopped
The backend confirmed the run has terminated. The turn is over.
StillCancelling
The backend accepted the cancel; the run had not stopped yet. detail
is the backend’s own account of what it is still waiting on.
Failed
The cancel never landed — a transport failure, or a refusal that is not
“still cancelling”. error is a plain sentence, already stripped of
protocol detail by the engine adapter.
Trait Implementations§
Source§impl Clone for CancelReply
impl Clone for CancelReply
Source§impl Debug for CancelReply
impl Debug for CancelReply
impl Eq for CancelReply
Source§impl PartialEq for CancelReply
impl PartialEq for CancelReply
impl StructuralPartialEq for CancelReply
Auto Trait Implementations§
impl Freeze for CancelReply
impl RefUnwindSafe for CancelReply
impl Send for CancelReply
impl Sync for CancelReply
impl Unpin for CancelReply
impl UnsafeUnpin for CancelReply
impl UnwindSafe for CancelReply
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more