Skip to main content

ToolSignals

Struct ToolSignals 

Source
pub struct ToolSignals {
Show 14 fields pub severity: f32, pub no_error_streak: u32, pub edit_count: u32, pub write_count: u32, pub read_count: u32, pub todowrite_count: u32, pub recent_edit_count: u32, pub recent_write_count: u32, pub recent_read_count: u32, pub recent_todowrite_count: u32, pub pure_bash_streak: u32, pub tests_passed: bool, pub turn_depth: u32, pub compacted: bool,
}
Expand description

Tool-execution signals extracted from a normalized Request.

A request-side processor stores these signals in State for crate::StageRouter and its classifier to consume.

Fields§

§severity: f32

Max severity across the recent window (last recent_window tool results): 0.0 clean · 0.3 soft (exit_nonzero) · 0.7 hard · 1.0 critical. Windowed so an error persists through the recovery turns instead of clearing the instant the next result is clean.

§no_error_streak: u32

Consecutive clean tool results back from the most recent. 0 if the last failed.

§edit_count: u32

Total edit-style tool calls in the request.

§write_count: u32

Total write-style tool calls in the request.

§read_count: u32

Read-type calls (Read tool + read-like Bash). Used by the build-pit gate.

§todowrite_count: u32

TodoWrite / planning tool calls. Investigative (non-producing) activity — recent todowrites distinguish exploring from spinning in the scorer.

§recent_edit_count: u32

Edit-type calls within the configured recent window (default: DEFAULT_RECENT_WINDOW).

§recent_write_count: u32

Write-type calls within the configured recent window (default: DEFAULT_RECENT_WINDOW).

§recent_read_count: u32

Read-type calls within the configured recent window (default: DEFAULT_RECENT_WINDOW).

§recent_todowrite_count: u32

TodoWrite calls within the configured recent window (default: DEFAULT_RECENT_WINDOW).

§pure_bash_streak: u32

Consecutive trailing tool calls in the Other category (no Write/Edit/Read/ Plan match). Surfaced in the classifier state summary; not scored directly.

§tests_passed: bool

At least one of the last three tool results matched a test-pass pattern.

§turn_depth: u32

Message-count proxy for turn depth. Wire-format dependent (Anthropic batches tool results into fewer messages than OpenAI-chat), so gates keyed on it are approximate across request origins.

§compacted: bool

The request carries a context-compaction summary (the agent’s context was summarised after overflowing). Compaction resets the router’s accumulated signals, so a task that was on the strong tier de-escalates back to weak — the picker uses this to force + hold the strong tier. Self-latching: the summary stays in the context prefix on every subsequent turn.

Implementations§

Source§

impl ToolSignals

Source

pub fn from_request(request: &Request, window_size: Option<usize>) -> Self

Extracts tool and progress signals from request.

window_size limits recent counters to the newest tool results. None uses DEFAULT_RECENT_WINDOW.

Trait Implementations§

Source§

impl Clone for ToolSignals

Source§

fn clone(&self) -> ToolSignals

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ToolSignals

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ToolSignals

Source§

fn default() -> ToolSignals

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,