#3853·inbox-zero

Rule chooser silently skips an email when the model invents a rule name

Author: SoyYoRafaCreated Sep 24, 2026Updated Sep 24, 2026

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:latest on Docker Compose, image revision 1977c736bf671545b22f5efc60684e57d2ebd9fe.
  • 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

  1. Provide candidate rules named Allowed A and Allowed B.
  2. Have getAiResponseSingleRule / generateObject return a valid object such as {"reasoning":"Synthetic example","ruleName":"Other","noMatchFound":false}.
  3. Call aiChooseRule and 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.