Hmbown/CodeWhale · error

Trigger '{trigger_id}' not found

Error message

Trigger '{trigger_id}' not found

What it means

get_trigger_for_owner found no delayed-trigger record for trigger_id that is owned by owner_session_id. Per the documented contract, absent, foreign, ownerless-legacy, and unreadable records all collapse into this one not-found error so cross-session trigger existence cannot be probed.

Source

Thrown at crates/tui/src/automation_manager.rs:1386

                CURRENT_TRIGGER_SCHEMA_VERSION
            );
        }
        Ok(record)
    }

    /// Load a trigger only when it belongs to the given session.
    ///
    /// Foreign, ownerless legacy, unreadable, and absent records share the same
    /// result so trigger existence cannot be disclosed across sessions.
    pub fn get_trigger_for_owner(
        &self,
        trigger_id: &str,
        owner_session_id: &str,
    ) -> Result<DelayedTriggerRecord> {
        self.get_trigger(trigger_id)
            .ok()
            .filter(|record| record.owner_session_id.as_deref() == Some(owner_session_id))
            .ok_or_else(|| anyhow::anyhow!("Trigger '{trigger_id}' not found"))
    }

    /// Atomically persist a trigger record.
    pub fn save_trigger(&self, record: &DelayedTriggerRecord) -> Result<()> {
        let path = self.trigger_path(&record.trigger_id)?;
        write_json_atomic(&path, record)
    }

    /// List triggers, newest first.  Pass `status_filter` to restrict results.
    pub fn list_triggers(
        &self,
        status_filter: Option<DelayedTriggerStatus>,
        limit: Option<usize>,
    ) -> Result<Vec<DelayedTriggerRecord>> {
        let mut out = Vec::new();
        if !self.triggers_dir.exists() {
            return Ok(out);
        }

View on GitHub (pinned to 0c42157ee5)

Solutions

  1. Verify the trigger id before calling — it may have fired and been deleted
  2. Confirm the trigger belongs to the current session; foreign triggers are intentionally invisible
  3. List the session's triggers to get a valid id
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at crates/tui/src/automation_manager.rs:1386 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Hmbown/CodeWhale@0c42157ee5 (2026-08-20). Data as JSON: /api/errors/02c7620e88209d5f. Report an issue: GitHub.