Skip to content

[bug] quick-router picks the time word as the weather location for "weather in <city> in the morning" #663

Description

@kevin8600

Summary

The deterministic quick-router extracts the wrong get_weather location when a weather query ends with an "in the " phrase: weather in Denver in the morning routes to location:"morning" instead of location:"Denver".

Steps to reproduce

  1. Route what's the weather in denver in the morning through genie_core::tools::quick::route (the path genie-ctl chat / the BFCL quick-router harness use).
  2. Inspect the emitted get_weather tool call.

Expected behavior

{"name":"get_weather","arguments":{"location":"denver","forecast":false}}

Same city as the already-correct what's the weather in denver tonight (-> location:"denver").

Actual behavior

{"name":"get_weather","arguments":{"location":"morning","forecast":false}}

extract_location_after_marker in crates/genie-core/src/tools/quick.rs splits with rsplit_once(" in ") (the last " in "). The trailing "in the morning" phrase carries its own " in ", which wins the split, so the location becomes "the morning" -> "morning". The post-split trailing-qualifier trim handles single-word / this <time> suffixes (" tonight", " this morning", ...) but never sees this case because the wrong span was already selected. Affects in the morning / in the afternoon / in the evening / in the night for both the weather and forecast phrasings.

Not a duplicate of the existing trailing-time work

Reproduces on current main (0d8904e). Distinct from:

Hardware

Non-Jetson (x86_64 dev / cross-build host) - pure deterministic-router logic, no hardware-specific surface.

GenieClaw version / commit

0d8904e (main)

Additional context

Tool-dispatch argument-correctness bug (the kind BFCL local-LLM tool-call scoring measures): only the location argument is wrong. A location-less weather in the morning should abstain rather than emit the time word as a bogus location.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions