block/buzz · warning · ValidationDiagnostic::Warning

plugin.json defaults.triggers: unknown key "{key}"

Error message

plugin.json defaults.triggers: unknown key "{key}"

What it means

Advisory lint during persona pack validation: inside defaults.triggers (or the legacy defaults.respond_to alias), a key is present that is not one of the accepted sub-keys mentions, keywords, all_messages. Emitted as a warning on the ValidationReport; the pack still loads and the unknown trigger key is ignored.

Source

Thrown at crates/buzz-persona/src/validate.rs:343

    // Unknown keys in `defaults`.
    if let Some(defaults) = obj.get("defaults").and_then(|v| v.as_object()) {
        let known_behavioral: HashSet<&str> = KNOWN_BEHAVIORAL_KEYS.iter().copied().collect();
        for key in defaults.keys() {
            if !known_behavioral.contains(key.as_str()) {
                report.warn(format!("plugin.json defaults: unknown key \"{key}\""));
            }
        }

        // Unknown keys in `defaults.triggers` (or legacy `defaults.respond_to`).
        let triggers_obj = defaults
            .get("triggers")
            .or_else(|| defaults.get("respond_to"))
            .and_then(|v| v.as_object());
        if let Some(rt) = triggers_obj {
            let known_rt: HashSet<&str> = KNOWN_RESPOND_TO_KEYS.iter().copied().collect();
            for key in rt.keys() {
                if !known_rt.contains(key.as_str()) {
                    report.warn(format!(
                        "plugin.json defaults.triggers: unknown key \"{key}\""
                    ));
                }
            }
        }
    }
}

/// For each skill directory referenced by a loaded persona, check that the
/// SKILL.md `name:` field matches the directory name. Emits warnings.
fn advisory_check_skill_names(
    pack_dir: &Path,
    loaded: &pack::LoadedPack,
    report: &mut ValidationReport,
) {
    // Collect all skill paths referenced by any persona.
    let mut skill_paths: Vec<std::path::PathBuf> = Vec::new();
    for persona in &loaded.personas {

View on GitHub (pinned to 934f3325c3)

Solutions

  1. Restrict defaults.triggers to mentions, keywords, and all_messages (see KNOWN_RESPOND_TO_KEYS at crates/buzz-persona/src/validate.rs:133)
  2. Fix misspellings so the intended trigger actually arms
  3. Move behavior that needs custom conditions into hooks_config or workflow logic instead of unsupported trigger keys

Example fix

// before (plugin.json)
"triggers": { "keywords": ["help"], "channels": ["random"] }

// after
"triggers": { "keywords": ["help"] }
Defensive patterns

Strategy: validation

Validate before calling

const KNOWN_TRIGGER_KEYS = new Set(["mentions", "keywords", "all_messages"]);
const triggers = manifest.defaults?.triggers ?? manifest.defaults?.respond_to ?? {};
for (const key of Object.keys(triggers)) {
  if (!KNOWN_TRIGGER_KEYS.has(key)) throw new Error(`defaults.triggers: unknown key: ${key}`);
}

Type guard

const isKnownTriggerKey = (k: string): k is TriggerKey => KNOWN_TRIGGER_KEYS.has(k as TriggerKey);

Prevention

When it happens

Trigger: Adding speculative trigger configuration (e.g. 'channels', 'schedule', 'regex') that the trigger engine does not read; misspelling 'keywords'; migrating from another pack format whose trigger options differ.

Common situations: Persona authors assuming richer trigger semantics than implemented; copy-paste between pack versions; a trigger silently never firing because its key is unknown.

Related errors


AI-assisted analysis of block/buzz@934f3325c3 (2026-08-20). Data as JSON: /api/errors/3cbe969a0af8ce06. Report an issue: GitHub.