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: f32Max 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: u32Consecutive clean tool results back from the most recent. 0 if the last failed.
edit_count: u32Total edit-style tool calls in the request.
write_count: u32Total write-style tool calls in the request.
read_count: u32Read-type calls (Read tool + read-like Bash). Used by the build-pit gate.
todowrite_count: u32TodoWrite / planning tool calls. Investigative (non-producing) activity —
recent todowrites distinguish exploring from spinning in the scorer.
recent_edit_count: u32Edit-type calls within the configured recent window (default: DEFAULT_RECENT_WINDOW).
recent_write_count: u32Write-type calls within the configured recent window (default: DEFAULT_RECENT_WINDOW).
recent_read_count: u32Read-type calls within the configured recent window (default: DEFAULT_RECENT_WINDOW).
recent_todowrite_count: u32TodoWrite calls within the configured recent window (default: DEFAULT_RECENT_WINDOW).
pure_bash_streak: u32Consecutive trailing tool calls in the Other category (no Write/Edit/Read/
Plan match). Surfaced in the classifier state summary; not scored directly.
tests_passed: boolAt least one of the last three tool results matched a test-pass pattern.
turn_depth: u32Message-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: boolThe 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
impl ToolSignals
Sourcepub fn from_request(request: &Request, window_size: Option<usize>) -> Self
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
impl Clone for ToolSignals
Source§fn clone(&self) -> ToolSignals
fn clone(&self) -> ToolSignals
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more