Repository navigation
fix: pass on classifier picks whose required slot is unfilled - #38
Merged
Merged
Conversation
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
Contributor
Author
|
Live check after merge, on an ovos-core alpha house stack with HiveMind, Switchboard installed from
Common query then answered it. On 1.1.2, the same utterance went to Home Assistant's Regression checks in the same session: 🤖 Generated with Claude Code |
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #37.
Summary
required slot unfilled, so later stages can answer. Live, "what is the boiling point of mercury in kelvin" went to Home Assistant'ssensorintent withmatch_data={}, and HA asked "which device?".[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.intent. Issue Classifier dispatches slot-required intents with no slot filled #37 said it should keep one, butRouter.routetreats 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 (_actreturnsNonefor any PASS). The skipped label is indetails["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-AWQon vLLM, temperature 0, one run), reading the harness LLM cache but never writing it:{}on every row{color: warm white, entity: office light},{brightness: 60, entity: master bedroom light}roll with it×2 andwhat a day(gold: none),does barbie say(easter egg).switch to finder(hub):app.launchbecame LLMunsupported.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.pyno longer completesIt 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: onmainit 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
test_slot_required_label_with_nothing_filled_passesfailed withDISPATCH != PASS. With a naiverequires_slot(search the raw line), the optional-group and empty-alternative cases failed withTrue is False. Before the review fixes, the typed-slot and other-language cases failed: 5 tests, each on its own assertion.pytest(160 passed),ruff check .,pylint ovos_switchboard scripts(10.00/10).Follow-ups, not in this PR
delegate_skills. OCP'splay {query}/start {query}is gated, which costs an extra LLM call before falling through; the outcome is the same as before.requires_slotandtools.guaranteed_slotsdefine "needs a slot" differently, so the LLM may still dispatch{}for a gated label.{}for unmapped skills' slot templates, and LLM tool calls that are missing required arguments are not rejected.ClassifierOptionsswitch for the gate.🤖 Generated with Claude Code
https://claude.ai/code/session_012QBrfKWBcxKVm7QkBcH3P2