Skip to content

fix(quick-router): accept a leading please on news requests - #909

Closed
kurosawareiji7007-hub wants to merge 1 commit into
GeniePod:mainfrom
kurosawareiji7007-hub:fix/quick-router-news-leading-please
Closed

fix(quick-router): accept a leading please on news requests#909
kurosawareiji7007-hub wants to merge 1 commit into
GeniePod:mainfrom
kurosawareiji7007-hub:fix/quick-router-news-leading-please

Conversation

@kurosawareiji7007-hub

@kurosawareiji7007-hub kurosawareiji7007-hub commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Summary

asks_for_news already drops a trailing please (and today / right now) before its exact-match set, but a leading please defeats the match. Natural polite news requests fell through to the LLM even though their non-please versions already route:

utterance on main expected
Please read the news ABSTAIN web_search{query: top news headlines, fresh: true}
Please what's the news? ABSTAIN same
Please tell me the news ABSTAIN same
Please give me the news ABSTAIN same
Please the latest news ABSTAIN same
Please what's the news today? ABSTAIN same

Same pattern as shopping-list (#843), scene/routine (#894), and time/date (#906).

Problem

Leading politeness broke deterministic news → web_search routing.

Root cause

asks_for_news only stripped trailing please / time qualifiers. A leading please left the string outside every exact-match arm.

Solution

Strip a leading please at the top of asks_for_news, before the existing trailing strips.

Scope boundaries

  • Only the asks_for_news classifier
  • No prompt growth; 4096 Jetson contract unchanged
  • Negatives stay off news; play_media morning-news briefing forms stay on play_media

Tests

  • Added news_request_accepts_a_leading_please
  • Existing routes_natural_news_phrasings_to_web_search unchanged

Before/after results

Standalone harness mirroring normalize + asks_for_news (Windows host cannot compile full genie-core due to Unix-only APIs):

  • Before: the six polite utterances above return false
  • After: those six return true; please help me stays false; please put on the morning news stays off the news matcher (play_media owns it)

Full cargo test -p genie-core --lib tools::quick will run in CI (Linux).

Regression protection

Focused unit test fails without the strip and passes with it; negatives assert no invented news route and no play_media steal.

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

  • Diff against main in crates/genie-core/src/tools/quick.rs + CHANGELOG.md
  • Standalone Rust harness mirroring normalize + asks_for_news with and without the leading-please strip (edition 2024, host x86_64-pc-windows-gnu). Full workspace cargo test could not be linked on this Windows host; CI Linux jobs exercise the real lib test.

What I observed

  • Without the strip: the six polite news utterances above all return false (ABSTAIN)
  • With the strip: those six return trueweb_search / top news headlines / fresh
  • please help me stays unrouted; please put on the morning news stays play_media{morning news}

Jetson gap: pure text classification; no hardware dependency. Reviewer can confirm with:

cargo test -p genie-core --no-default-features --lib tools::quick::tests::news_request_accepts_a_leading_please -- --exact

Fixes

Fixes #908

Summary by CodeRabbit

  • Bug Fixes
    • Polite requests such as “Please read the news” now correctly open fresh top-headline search results.
    • Improved handling of requests combining leading or trailing “please” with time qualifiers.
    • Unrelated requests, including requests to play the morning news, continue routing correctly.

Polite forms like "please read the news" and "please tell me the news"
fell through to the LLM because asks_for_news only stripped trailing
please. Mirror time/date and scene/routine leading-please handling.

Fixes GeniePod#908
@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 60d14905-4621-4066-9a15-f74185db4404

📥 Commits

Reviewing files that changed from the base of the PR and between 02a577d and c832627.

📒 Files selected for processing (2)
  • CHANGELOG.md
  • crates/genie-core/src/tools/quick.rs

📝 Walkthrough

Walkthrough

The quick router now strips a leading please from news requests before exact matching. Tests cover headline searches, unrelated polite requests, and morning-news media routing. The changelog documents the normalization behavior.

Changes

News routing

Layer / File(s) Summary
News matcher normalization and regression coverage
crates/genie-core/src/tools/quick.rs, CHANGELOG.md
asks_for_news normalizes leading politeness before matching, while tests verify web_search, negative cases, and preserved play_media routing. The changelog records the update.

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

Possibly related PRs

Suggested labels: bug

Suggested reviewers: matedev01, ai-hpc, tryeverything24

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: allowing a leading "please" in quick-router news requests.
Linked Issues check ✅ Passed The change matches #908: leading-please news routing now reaches fresh web_search, with regression coverage and preserved play_media/negative behavior.
Out of Scope Changes check ✅ Passed The PR stays narrowly scoped to the news-routing fix, a regression test, and changelog notes; no unrelated changes are evident.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@kurosawareiji7007-hub

Copy link
Copy Markdown
Contributor Author

Closing to free the per-author open-PR slot for a higher-priority systems reliability fix (#936 STT whisper-server bounded HTTP). The news leading-please issue (#908) remains open if someone wants to reopen or re-ship later.

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: leading please on news requests falls through to the LLM

1 participant