fix(quick-router): abstain on an outdoor temperature query instead of thermostat status - #860
Conversation
… thermostat status
"what's the temperature outside" is a weather question, not an indoor
thermostat reading, but home_status_target matched "temperature" and
emitted a garbled home_status{entity:"temperature outside"} — there is
no such device. Abstain when a temperature/climate status query is
outdoor-qualified ("outside"/"outdoor") so the LLM grounds it as
weather, mirroring the branch's existing indoor-only scoping (the attic
arm).
|
Warning Review limit reached
Next review available in: 31 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe quick router now abstains from ChangesTemperature routing
Estimated code review effort: 2 (Simple) | ~5 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
matedev01
left a comment
There was a problem hiding this comment.
LGTM — home_status_target matched temperature/climate as a substring, so an outdoor temperature query (a weather question) misrouted to home_status for a nonexistent 'temperature outside' device instead of abstaining to the LLM/weather path. Verified: clippy -D warnings clean, quick-router tests (103) pass, fmt clean, live BFCL strict_accuracy 96.15% (no regression).
Summary
home_status_targetmatchestemperature/climateas a substring, so an outdoor temperature query — a weather question — misrouted tohome_status{entity:"temperature outside"}, a device that doesn't exist. Abstain when a temperature/climate status query is outdoor-qualified so the LLM grounds it as weather. Closes #859.Changes
home_status_target's thermostat branch, returnNonewhen the target contains"outside"/"outdoor"(coversoutdoorstoo), before the entity is emitted. This mirrors the branch's existing indoor-only scoping — it already special-cases"attic"→"attic temperature".outdoor_temperature_query_abstains_instead_of_thermostat_status: four outdoor-qualified forms must abstain; the indoor"what's the temperature"(→thermostat) and"is the climate control on"(→climate control) must still resolve.Real Behavior Proof
Tested profile / hardware (check all that apply):
jetsonraspberry_piportable_sbclaptopmacWhat I ran
x86_64 Linux dev machine (laptop profile),
rustc 1.98.0-nightly, branch cut from9bff670. The changed path is pure string routing inquick::route— no audio/HA/hardware dependency — soroute()unit tests exercise it end-to-end; the validation gap is only that I did not run the voice loop on a device.main:cargo test -p genie-core --lib outdoor_temperature_querycargo fmt --all -- --checkcargo clippy -p genie-core --all-targets --locked -- -D warningscargo test -p genie-core --libandcargo test -p genie-core --lib --no-default-featuresWhat I observed
Before the fix (new test against unmodified
main):i.e.
route("what's the temperature outside")→home_status{entity:"temperature outside"}.After the fix:
route("what's the temperature outside")→ abstainsroute("what is the temperature outdoors")→ abstainsroute("what's the outdoor temperature")→ abstainsroute("how's the climate outside")→ abstains"what's the temperature"→home_status{entity:"thermostat"};"is the climate control on"→home_status{entity:"climate control"}Gate results: fmt clean; clippy clean under
-D warnings; lib tests 957 passed / 0 failed (default) and 858 passed / 0 failed (--no-default-features).Test plan
cargo test -p genie-core --lib outdoor_temperature_query— the new case fails onmain, passes here.cargo test -p genie-core --lib status— the home_status suite stays green.Notes for reviewers
Scoped to the thermostat/climate branch only, so the
outside/outdoorcheck can't affect other device statuses. An indoor query that happens to contain "outdoor" in a room name ("the outdoor kitchen thermostat") would also abstain — that seemed the safer default than reporting a possibly-wrong reading, and such phrasings are rare; happy to narrow it if you'd prefer.Summary by CodeRabbit