pub struct RedelegationCapSignal(/* private fields */);Expand description
Shared signal tracking total re-delegation attempts across one run (#2265).
Why: [RedelegatingRunner] and run_task::assemble_report are different
call sites that both need to observe the SAME attempt count / cap state —
the runner to enforce the cap, the report assembler to recognise a
cap-triggered terminal state even when the PM’s own loop error doesn’t
literally say so (e.g. the PM’s NEXT turn separately exhausts its own
budget after seeing the cap-reached tool error). An Arc-wrapped atomic
pair is the simplest thing that is Send + Sync and cheap to clone into
both places.
What: new() starts at zero attempts, cap not reached. is_cap_reached()
and attempts() are read-only accessors for assemble_report;
record_attempt/mark_cap_reached are private, called only by
[RedelegatingRunner].
Test: redelegating_runner_stops_at_cap_and_marks_signal.
Implementations§
Source§impl RedelegationCapSignal
impl RedelegationCapSignal
Sourcepub fn new() -> Self
pub fn new() -> Self
Build a fresh signal with zero recorded attempts.
Why: Each execute_run_task call needs its OWN signal — attempts must
never leak across independent runs.
What: Self::default().
Test: redelegating_runner_retries_on_llm_error_then_succeeds.
Sourcepub fn is_cap_reached(&self) -> bool
pub fn is_cap_reached(&self) -> bool
Whether the re-delegation cap was hit during this run.
Why: assemble_report uses this to distinguish a cap-triggered
terminal state from an unrelated PM-loop error.
What: Reads the latched flag.
Test: redelegating_runner_stops_at_cap_and_marks_signal.
Trait Implementations§
Source§impl Clone for RedelegationCapSignal
impl Clone for RedelegationCapSignal
Source§fn clone(&self) -> RedelegationCapSignal
fn clone(&self) -> RedelegationCapSignal
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RedelegationCapSignal
impl Debug for RedelegationCapSignal
Source§impl Default for RedelegationCapSignal
impl Default for RedelegationCapSignal
Source§fn default() -> RedelegationCapSignal
fn default() -> RedelegationCapSignal
Auto Trait Implementations§
impl Freeze for RedelegationCapSignal
impl RefUnwindSafe for RedelegationCapSignal
impl Send for RedelegationCapSignal
impl Sync for RedelegationCapSignal
impl Unpin for RedelegationCapSignal
impl UnsafeUnpin for RedelegationCapSignal
impl UnwindSafe for RedelegationCapSignal
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<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