Skip to content

fix(quick-router): accept a leading please on forget commands - #924

Open
galuis116 wants to merge 1 commit into
GeniePod:mainfrom
galuis116:fix/forget-leading-please
Open

fix(quick-router): accept a leading please on forget commands#924
galuis116 wants to merge 1 commit into
GeniePod:mainfrom
galuis116:fix/forget-leading-please

Conversation

@galuis116

@galuis116 galuis116 commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #921. memory_forget_query matches its prefixes at token 0 and already
stripped a trailing please, but never a leading one — so please forget the wifi password matched no prefix.

Unlike the sibling leading-please gaps, missing here does not abstain.
route runs memory_forget_query and then memory_recall_query, whose
household / note / semantic matchers are contains-based. The utterance was
claimed by recall, and the router emitted a confidently wrong tool:

"please forget the wifi password"
    -> memory_recall{query: "please forget the wifi password", limit: 3}
expected
    -> memory_forget{query: "wifi password"}
utterance before after
Please forget the wifi password memory_recall{"please forget the wifi password"} memory_forget{"wifi password"}
Please forget my old locker combination recall / ABSTAIN memory_forget{"old locker combination"}
Please delete what you know about my car ABSTAIN memory_forget{"my car"}

Why this one is worse than the sibling gaps

A missed route costs a fallthrough to the LLM, which can still recover. Here
the user asked to delete a memory and the router reads it back instead:

  • the secret is spoken aloud rather than erased,
  • the query is please forget the wifi password, which is not a stored fact
    and matches nothing useful,
  • the user gets a plausible-looking answer and no signal that the delete never
    happened.

A privacy-intent utterance silently becoming a retrieval is a correctness bug
with a safety edge, not just a coverage gap.

Changes

  • Strip a single leading please before the prefix loop in
    memory_forget_query, mirroring scene_or_routine_activation_request and
    play_media_request.
  • The bare-pronoun abstention (that / it / this) and the
    trailing-please trim inside the loop are untouched, so please forget about it still abstains rather than deleting the literal word.
  • New regression test forget_command_accepts_a_leading_please.

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 laptop (Ubuntu 22.04 LTS, kernel 6.8.0-136-generic,
rustc 1.96.0 / cargo 1.96.0). No Jetson available to me — see the validation
gap below.

cargo test -p genie-core
cargo clippy -p genie-core --all-targets
cargo fmt -p genie-core -- --check

Plus a temporary probe binding route() directly, so I could read the actual
emitted ToolCall on both main and this branch — the whole point of this bug
is which tool fires, so an is_none()-style assertion would not have shown
it. The probe was removed before committing; only the permanent regression test
remains.

What I observed

Probe output on main — the delete request answered as a lookup:

please forget the wifi password -> memory_recall {"limit":3,"query":"please forget the wifi password"}
forget the wifi password        -> memory_forget {"query":"wifi password"}

Probe output on this branch:

please forget the wifi password          -> memory_forget {"query":"wifi password"}
please forget my old locker combination  -> memory_forget {"query":"old locker combination"}
please delete what you know about my car -> memory_forget {"query":"my car"}
please forget about it                   -> ABSTAIN

The polite call is now byte-identical to the bare call, and the bare-pronoun
abstention still holds under a leading please.

cargo test -p genie-core: 1005 lib tests passed, 0 failed, 6 ignored, and
all integration suites green. cargo clippy --all-targets produced no
warnings; cargo fmt --check produced no diff.

Validation gap

I could not verify on Jetson hardware. The equivalent verification path: this
change is confined to crates/genie-core/src/tools/quick.rs, a pure
string→ToolCall function with no I/O, no async, no hardware dependency, and
no model involvement. Its entire contract is which ToolCall comes out for a
given utterance, asserted directly above. The emitted call is byte-identical to
the one the bare utterance already produces and already dispatches on Jetson
today, so the memory subsystem downstream sees nothing new. Nothing in the diff
touches audio, the dashboard, or the model prompt.

Test plan

  1. Cherry-pick forget_command_accepts_a_leading_please onto main alone and
    run it — it fails, and fails loudly: main returns memory_recall, not
    None.
  2. Check out this branch, rerun — passes.
  3. On a device with memories stored, say "remember my wifi password is X", then
    "please forget the wifi password", then "what's my wifi password" — confirm
    the fact is gone rather than read back.

Notes for reviewers

  • The test asserts the polite call equals the bare call by name and
    arguments, not merely that some route exists — a partial fix that stripped
    please from the tool selection but not from the query would still fail.
  • No prompt growth, no new dependencies. The 4096-token Jetson context contract
    is untouched.
  • Behavior is unchanged for every utterance that does not begin with please .

memory_forget_query matches its prefixes at token 0 and already stripped
a trailing "please", but never a leading one, so "please forget the wifi
password" matched no prefix.

Unlike the sibling leading-"please" gaps, missing here does not abstain.
`route` runs memory_forget_query and then memory_recall_query, whose
household/note/semantic matchers are contains-based — so the utterance
was claimed by recall and the router emitted a confidently wrong tool:

  "please forget the wifi password"
      -> memory_recall{query: "please forget the wifi password", limit: 3}
  expected
      -> memory_forget{query: "wifi password"}

A delete request answered as a lookup is worse than a fallthrough: the
secret is read back rather than erased, the query carries the politeness
token and matches no stored fact, and the user gets a plausible-looking
answer with no signal that the delete never happened.

Strip a single leading "please " before the prefix loop, mirroring
scene_or_routine_activation_request and play_media_request. The
bare-pronoun abstention (that/it/this) and the trailing-"please" trim
inside the loop are untouched, so "please forget about it" still
abstains rather than deleting the literal word.

Closes GeniePod#921
@github-actions github-actions Bot added the bug Something isn't working label Jul 30, 2026
@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The deterministic router now handles leading “please” in memory forget and delete commands. Tests verify equivalent query extraction for polite and bare forms while preserving abstention for bare-pronoun references.

Changes

Memory Forget Routing

Layer / File(s) Summary
Forget prefix handling and regression coverage
crates/genie-core/src/tools/quick.rs
Leading "please " is stripped before forget/delete prefix matching, with tests covering routing, query extraction, trailing politeness, and pronoun-based abstention.

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

Possibly related PRs

Suggested reviewers: matedev01, ultrahighsuper, yurii214

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The change matches issue #921 by routing leading-please forget/delete commands to memory_forget while preserving pronoun abstention and adding regression tests.
Out of Scope Changes check ✅ Passed The PR appears tightly scoped to the quick-router fix and related tests, with no obvious unrelated changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: quick-router now accepts a leading “please” on forget commands.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Fix failing CI checks
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

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: "please forget the wifi password" routes to memory_recall — a delete request is answered as a lookup

1 participant