fix(quick-router): accept a leading please on news requests - #909
Closed
kurosawareiji7007-hub wants to merge 1 commit into
Closed
fix(quick-router): accept a leading please on news requests#909kurosawareiji7007-hub wants to merge 1 commit into
kurosawareiji7007-hub wants to merge 1 commit into
Conversation
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
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe quick router now strips a leading ChangesNews routing
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
This was referenced Jul 30, 2026
Contributor
Author
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.
Summary
asks_for_newsalready drops a trailingplease(andtoday/right now) before its exact-match set, but a leadingpleasedefeats the match. Natural polite news requests fell through to the LLM even though their non-pleaseversions already route:mainPlease read the newsweb_search{query: top news headlines, fresh: true}Please what's the news?Please tell me the newsPlease give me the newsPlease the latest newsPlease what's the news today?Same pattern as shopping-list (#843), scene/routine (#894), and time/date (#906).
Problem
Leading politeness broke deterministic news →
web_searchrouting.Root cause
asks_for_newsonly stripped trailingplease/ time qualifiers. A leadingpleaseleft the string outside every exact-match arm.Solution
Strip a leading
pleaseat the top ofasks_for_news, before the existing trailing strips.Scope boundaries
asks_for_newsclassifierplay_mediaTests
news_request_accepts_a_leading_pleaseroutes_natural_news_phrasings_to_web_searchunchangedBefore/after results
Standalone harness mirroring
normalize+asks_for_news(Windows host cannot compile fullgenie-coredue to Unix-only APIs):falsetrue;please help mestaysfalse;please put on the morning newsstays off the news matcher (play_media owns it)Full
cargo test -p genie-core --lib tools::quickwill 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
Tested profile / hardware (check all that apply):
jetsonraspberry_piportable_sbclaptopmacWhat I ran
mainincrates/genie-core/src/tools/quick.rs+CHANGELOG.mdnormalize+asks_for_newswith and without the leading-pleasestrip (edition 2024, hostx86_64-pc-windows-gnu). Full workspacecargo testcould not be linked on this Windows host; CI Linux jobs exercise the real lib test.What I observed
false(ABSTAIN)true→web_search/top news headlines/freshplease help mestays unrouted;please put on the morning newsstaysplay_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 -- --exactFixes
Fixes #908
Summary by CodeRabbit