pub struct TaskSession {Show 15 fields
pub session_id: SessionId,
pub agent_id: Uuid,
pub delegation_chain_snapshot: Vec<String>,
pub declared_intent: String,
pub authorized_tools: Vec<String>,
pub time_limit: Duration,
pub call_budget: u64,
pub calls_made: u64,
pub rate_limit_per_minute: Option<u64>,
pub rate_window_start: DateTime<Utc>,
pub rate_window_calls: u64,
pub rate_limit_window_secs: u64,
pub data_sensitivity_ceiling: DataSensitivity,
pub created_at: DateTime<Utc>,
pub status: SessionStatus,
}Expand description
A task session scoping what an agent is allowed to do.
Fields§
§session_id: SessionIdUnique session identifier.
agent_id: UuidThe agent operating within this session.
delegation_chain_snapshot: Vec<String>Snapshot of the delegation chain at session creation time.
declared_intent: StringThe declared intent for this session (free-form string).
Tools this session is authorized to call (from policy evaluation).
time_limit: DurationMaximum duration for this session.
call_budget: u64Maximum number of tool calls allowed.
calls_made: u64Number of tool calls made so far.
rate_limit_per_minute: Option<u64>Per-minute rate limit. None means no rate limit (only lifetime budget applies).
rate_window_start: DateTime<Utc>Start of the current rate-limit window.
rate_window_calls: u64Number of calls within the current rate-limit window.
rate_limit_window_secs: u64Duration of the rate-limit window in seconds. Defaults to 60.
data_sensitivity_ceiling: DataSensitivityMaximum data sensitivity this session may access.
created_at: DateTime<Utc>When this session was created.
status: SessionStatusCurrent session status.
Implementations§
Source§impl TaskSession
impl TaskSession
Sourcepub fn is_expired(&self) -> bool
pub fn is_expired(&self) -> bool
Returns true if the session has exceeded its time limit.
Sourcepub fn is_budget_exceeded(&self) -> bool
pub fn is_budget_exceeded(&self) -> bool
Returns true if the session’s call budget is exhausted.
Returns true if the given tool is authorized in this session.
Sourcepub fn check_rate_limit(&mut self) -> bool
pub fn check_rate_limit(&mut self) -> bool
Check and update the rate-limit window. Returns true if the call should be rejected due to rate limiting.
Trait Implementations§
Source§impl Clone for TaskSession
impl Clone for TaskSession
Source§fn clone(&self) -> TaskSession
fn clone(&self) -> TaskSession
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more