Skip to content

fix(quick-router): abstain on an outdoor temperature query instead of thermostat status - #860

Merged
matedev01 merged 3 commits into
GeniePod:mainfrom
michiot05:fix/outdoor-temperature-abstains
Jul 27, 2026
Merged

fix(quick-router): abstain on an outdoor temperature query instead of thermostat status#860
matedev01 merged 3 commits into
GeniePod:mainfrom
michiot05:fix/outdoor-temperature-abstains

Conversation

@michiot05

@michiot05 michiot05 commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Summary

home_status_target matches temperature/climate as a substring, so an outdoor temperature query — a weather question — misrouted to home_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

  • In home_status_target's thermostat branch, return None when the target contains "outside"/"outdoor" (covers outdoors too), before the entity is emitted. This mirrors the branch's existing indoor-only scoping — it already special-cases "attic""attic temperature".
  • New test 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

  • I have built and run the affected code locally (or noted why I could not).
  • I have verified the change end-to-end on Jetson hardware.
  • I have NOT verified on Jetson hardware, and I explain the equivalent verification path or validation gap below.

Tested profile / hardware (check all that apply):

  • jetson
  • raspberry_pi
  • portable_sbc
  • laptop
  • mac
  • CI-only / docs-only
  • Not run locally

What I ran

x86_64 Linux dev machine (laptop profile), rustc 1.98.0-nightly, branch cut from 9bff670. The changed path is pure string routing in quick::route — no audio/HA/hardware dependency — so route() unit tests exercise it end-to-end; the validation gap is only that I did not run the voice loop on a device.

  1. Wrote the failing test first and ran it against unmodified main: cargo test -p genie-core --lib outdoor_temperature_query
  2. Applied the fix and re-ran, then the full gates:
    • cargo fmt --all -- --check
    • cargo clippy -p genie-core --all-targets --locked -- -D warnings
    • cargo test -p genie-core --lib and cargo test -p genie-core --lib --no-default-features

What I observed

Before the fix (new test against unmodified main):

"what's the temperature outside" must abstain, not report a thermostat status
test result: FAILED. 0 passed; 1 failed

i.e. route("what's the temperature outside")home_status{entity:"temperature outside"}.

After the fix:

  • route("what's the temperature outside") → abstains
  • route("what is the temperature outdoors") → abstains
  • route("what's the outdoor temperature") → abstains
  • route("how's the climate outside") → abstains
  • unchanged: "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 on main, 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/outdoor check 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

  • Bug Fixes
    • Improved handling of temperature and climate requests referring to outdoor conditions.
    • Outdoor temperature queries are no longer incorrectly interpreted as indoor thermostat status requests.
    • Indoor temperature and climate-control requests continue to return home status information.
    • Added a regression test covering common “outside/outdoor” phrasings to prevent future routing issues.

… 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).
@github-actions github-actions Bot added the bug Something isn't working label Jul 24, 2026
@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@matedev01, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 31 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 6825241f-eb26-4c8f-a89c-bfbe58bf8904

📥 Commits

Reviewing files that changed from the base of the PR and between 3c754f1 and 32113fa.

📒 Files selected for processing (1)
  • crates/genie-core/src/tools/quick.rs
📝 Walkthrough

Walkthrough

The quick router now abstains from home_status for outdoor temperature or climate queries. Regression tests cover outdoor variants and confirm indoor thermostat and climate-control routing remains unchanged.

Changes

Temperature routing

Layer / File(s) Summary
Outdoor routing guard and regression coverage
crates/genie-core/src/tools/quick.rs
Outdoor-qualified temperature and climate targets no longer produce thermostat status entities; tests cover outdoor variants and preserve indoor routing.

Estimated code review effort: 2 (Simple) | ~5 minutes

Possibly related PRs

Suggested labels: bug

Suggested reviewers: matedev01

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main fix: abstaining on outdoor temperature queries instead of routing them to thermostat status.
Linked Issues check ✅ Passed The change matches issue #859 by abstaining on outdoor temperature/climate phrasing while preserving indoor thermostat routing.
Out of Scope Changes check ✅ Passed The patch stays focused on the router fix and regression tests, with no unrelated code changes indicated.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@matedev01 matedev01 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

@matedev01
matedev01 merged commit e38c257 into GeniePod:main Jul 27, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] quick-router: "what's the temperature outside" misroutes to home_status instead of a weather query

2 participants