Skip to content

fix: pass on classifier picks whose required slot is unfilled - #38

Merged
mikejgray merged 2 commits into
mainfrom
fix/classifier-unfilled-required-slots
Nov 26, 2026
Merged

mikejgray merged 2 commits into
mainfrom
fix/classifier-unfilled-required-slots

Conversation

@mikejgray

Copy link
Copy Markdown
Contributor

Closes #37.

Summary

  • The classifier stage no longer dispatches an intent when every phrase of that intent needs a slot and the utterance filled none. It passes instead, with reason required slot unfilled, so later stages can answer. Live, "what is the boiling point of mercury in kelvin" went to Home Assistant's sensor intent with match_data={}, and HA asked "which device?".
  • A phrase counts as needing a slot only if every expansion keeps one: [about {topic}] and (in {location}|) make the slot optional. Typed slots ({number:n}) count. Only the device language's accepted (well_formed) samples are used.
  • The PASS carries no intent. Issue Classifier dispatches slot-required intents with no slot filled #37 said it should keep one, but Router.route treats a classifier verdict with an intent as routed, so the harness would have scored the passed utterance as dispatched. Live OVOS is unaffected either way (_act returns None for any PASS). The skipped label is in details["unfilled"], which the decision log writes.

Measured effect

21 harness rows hit the gate: 14 distinct utterances (7 dev, 7 test) across the two devices. I routed those rows through the full router with live LLM calls (Qwen/Qwen3-14B-AWQ on vLLM, temperature 0, one run), reading the harness LLM cache but never writing it:

before (classifier dispatch) after (gate, then LLM)
correct intent vs gold 16 / 21 19 / 21
slots the skill receives {} on every row filled, e.g. {color: warm white, entity: office light}, {brightness: 60, entity: master bedroom light}
  • Fixed: roll with it ×2 and what a day (gold: none), does barbie say (easter egg).
  • Broken: switch to finder (hub): app.launch became LLM unsupported.
  • Wrong both times: thank advice → knowledge.ask (gold: none).

The intent score understates the gain. Before, the slot-needing rows were "correct" but the skill got nothing to act on, the same failure as the mercury question.

Cost: gated utterances now wait for the LLM (route plus addressee gate, each bounded by timeout_s) instead of settling in milliseconds. If the LLM is configured but down, they end in the documented silent decline. Before, they got an audible wrong dispatch.

⚠️ scripts/check_harness.py no longer completes

It stops with RuntimeError: LLM unavailable: not in the harness cache, because the gated rows now reach the LLM stage and the cache has no answers for them. CI does not run it. Until the intent-eval references and LLM cache are refreshed for these rows, the harness can't confirm "exactly the decisions that were measured". Verified: on main it gives 4× 246/246 identical. With a control mutation that passes every classifier dispatch, it goes red the same way, so it does see this gate.

Test plan

  • New tests fail on the unfixed code, for the reason named, and pass after. Before the gate, test_slot_required_label_with_nothing_filled_passes failed with DISPATCH != PASS. With a naive requires_slot (search the raw line), the optional-group and empty-alternative cases failed with True is False. Before the review fixes, the typed-slot and other-language cases failed: 5 tests, each on its own assertion.
  • Controls that must not change pass before and after: a label with a slot-free sample, an Adapt label, and the slot filled by a loose template match.
  • An adversarial review mutated the new logic 21 times. 16 mutations were caught on an assertion. Of the 5 that went undetected, 3 were gaps now pinned by tests (classifier-only scope, details kept), and one was an equivalent mutation.
  • pytest (160 passed), ruff check ., pylint ovos_switchboard scripts (10.00/10).
  • Live on a house stack. Not done: the routing change was measured through the router with the live LLM, but not end to end through ovos-core.

Follow-ups, not in this PR

  • Skip the gate for delegate_skills. OCP's play {query} / start {query} is gated, which costs an extra LLM call before falling through; the outcome is the same as before.
  • requires_slot and tools.guaranteed_slots define "needs a slot" differently, so the LLM may still dispatch {} for a gated label.
  • The decider stage has the same gap (deferred in Classifier dispatches slot-required intents with no slot filled #37).
  • Pre-existing: the exact stage dispatches {} for unmapped skills' slot templates, and LLM tool calls that are missing required arguments are not rejected.
  • Maybe a ClassifierOptions switch for the gate.

🤖 Generated with Claude Code

https://claude.ai/code/session_012QBrfKWBcxKVm7QkBcH3P2

mikejgray and others added 2 commits November 26, 2026 13:41
The classifier dispatched intents whose every phrase needs a slot even
when no template matched, so the skill got empty match_data. Live:
"what is the boiling point of mercury in kelvin" went to Home
Assistant's sensor intent, which asked "which device?".

ClassifierStage now passes such picks on (reason "required slot
unfilled"), so later stages can answer them. A sample counts as
needing a slot only if every expansion keeps one: [about {topic}] and
(in {location}|) make it optional. The PASS carries no intent, because
Router.route counts a classifier verdict with an intent as routed; the
skipped label is in details["unfilled"] for the decision log.

Closes #37

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012QBrfKWBcxKVm7QkBcH3P2
Review follow-up for #37:
- slot_required now uses every well_formed sample, and requires_slot
  recognises typed slots ({number:n}) and any name the matcher accepts.
  Before, typed lines were dropped first, so a label could be gated
  although a typed sample had a slot-free expansion, and all-typed
  labels were never gated.
- Only the device language's samples count. Before, another language's
  all-slot samples gated the label for every language.
- Tests pin that the gate is classifier-only and that a gated PASS keeps
  the classifier details.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012QBrfKWBcxKVm7QkBcH3P2
@mikejgray
mikejgray merged commit 1fbdfec into main Nov 26, 2026
4 checks passed
@mikejgray
mikejgray deleted the fix/classifier-unfilled-required-slots branch November 26, 2026 20:09
@mikejgray

Copy link
Copy Markdown
Contributor Author

Live check after merge, on an ovos-core alpha house stack with HiveMind, Switchboard installed from main at 1fbdfec. This is the unchecked "Live on a house stack" item in the test plan.

what is the boiling point of mercury in kelvin, from Switchboard's decision log:

step decision time
exact pass, no unique template owner 2.8 ms
classifier pass, required slot unfilled; unfilled: skill-homeassistant.oscillatelabsllc:sensor, confidence 0.7365, label_how: nearest examples 8.4 ms
llm ask_knowledge, p_addressed 1.0 1.2 s

Common query then answered it. On 1.1.2, the same utterance went to Home Assistant's sensor intent with match_data={}, which replied "I'm not sure which device you want."

Regression checks in the same session: what time is it (exact → date-time, 0.19 s), tell me a joke (exact → jokes, 0.16 s), and what's the temperature of the living room (exact → HA sensor, entity filled, 0.24 s).

🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Classifier dispatches slot-required intents with no slot filled

1 participant