Rule chooser silently skips an email when the model invents a rule name
Summary
When the rule-selection model returns a valid structured response with
noMatchFound: false and a ruleName that is not among the candidate rules,
Inbox Zero silently resolves zero rules and records the email as SKIPPED.
Configured LLM fallbacks are not tried because the model response itself is
valid. This is a contract-validation failure, not a request or JSON parse error.
Version and environment
- Self-hosted
ghcr.io/elie222/inbox-zero:lateston Docker Compose, image revision1977c736bf671545b22f5efc60684e57d2ebd9fe. - Rule selection through an OpenAI-compatible model with a configured LLM fallback. The issue concerns how the app handles an out-of-list name after receiving a structured response, rather than any specific model or provider.
Reproduction
- Provide candidate rules named
Allowed AandAllowed B. - Have
getAiResponseSingleRule/generateObjectreturn a valid object such as{"reasoning":"Synthetic example","ruleName":"Other","noMatchFound":false}. - Call
aiChooseRuleand inspect its result.
Actual: the exact-name lookup finds no candidate and returns rules: [].
runRules subsequently records a skipped result. The fallback LLM is never
called.
Expected: an out-of-list name should be treated as an invalid model answer. Retry with the available rule names, invoke the configured fallback, or surface an explicit classification error instead of silently skipping the email.
Source: elie222/inbox-zero