MCPcopy Create free account
hub / github.com/AI45Lab/Code / check_idle

Method check_idle

core/src/ahp/executor.rs:344–356  ·  view source on GitHub ↗

Check if agent is idle and create idle event if threshold exceeded.

(&self)

Source from the content-addressed store, hash-verified

342
343 /// Check if agent is idle and create idle event if threshold exceeded.
344 pub fn check_idle(&self) -> Option<IdleEvent> {
345 let elapsed = self.get_idle_duration_ms();
346 if elapsed >= self.idle_threshold_ms {
347 Some(IdleEvent {
348 idle_duration_ms: elapsed,
349 idle_reason: "no_activity".to_string(),
350 last_event_type: None,
351 suggested_action: Some("dream".to_string()),
352 })
353 } else {
354 None
355 }
356 }
357
358 /// Set memory summary for context population.
359 ///

Calls 1

get_idle_duration_msMethod · 0.80