zeroclaw-labs/zeroclaw · error · anyhow::Error

Classification rule for hint '{hint}' has no matching criter

Error message

Classification rule for hint '{hint}' has no matching criteria. Provide keywords/patterns or set min_length/max_length.

What it means

Error "Classification rule for hint '{hint}' has no matching criteria. Provide keywords/patterns or set min_length/max_length." thrown in zeroclaw-labs/zeroclaw.

Source

Thrown at crates/zeroclaw-tools/src/model_routing_config.rs:798

                match max_length_update {
                    MaybeSet::Set(value) => next_rule.max_length = Some(value),
                    MaybeSet::Null => next_rule.max_length = None,
                    MaybeSet::Unset => {}
                }

                match priority_update {
                    MaybeSet::Set(value) => next_rule.priority = value,
                    MaybeSet::Null => next_rule.priority = 0,
                    MaybeSet::Unset => {}
                }

                if matches!(classification_enabled, Some(true)) {
                    Self::ensure_rule_defaults(&mut next_rule, &hint);
                }

                if !Self::has_rule_matcher(&next_rule) {
                    anyhow::bail!(
                        "Classification rule for hint '{hint}' has no matching criteria. Provide keywords/patterns or set min_length/max_length."
                    );
                }

                cfg.query_classification
                    .rules
                    .retain(|rule| rule.hint != hint);
                cfg.query_classification.rules.push(next_rule);
            }
        }

        Self::normalize_and_sort_rules(&mut cfg.query_classification.rules);
        cfg.query_classification.enabled = !cfg.query_classification.rules.is_empty();

        cfg.save().await?;

        Ok(ToolResult {
            success: true,

View on GitHub (pinned to 88bb9c8533)

Solutions

  1. Add keywords/patterns or min_length/max_length criteria to the classification rule.

When it happens

Trigger: Thrown at crates/zeroclaw-tools/src/model_routing_config.rs:798 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of zeroclaw-labs/zeroclaw@88bb9c8533 (2026-08-23). Data as JSON: /api/errors/0c480ab7ee8a3ef5. Report an issue: GitHub.