Skip to main content

check_triggers

Function check_triggers 

Source
pub fn check_triggers(
    storage: &dyn StorageBackend,
    session_id: &str,
    tool_name: &str,
    file_path: Option<&str>,
    pattern: Option<&str>,
) -> Vec<AutoInsight>
Expand description

Check trigger conditions against session activity and return any auto-insights.

Three triggers are evaluated:

  1. Directory focus: 3+ files read from the same directory suggests deep exploration.
  2. Edit after read: Editing a file that was previously read indicates an informed change.
  3. Repeated search: Same search pattern used 2+ times suggests a recurring need.

Each trigger checks has_auto_insight() to avoid duplicate insights within the same session.