discord: resolve the city people actually typed #62
No reviewers
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: Jinemi/thermograph#62
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/discord-city-resolution"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Reported live from #general:
Vilnius has been in
cities.jsonthe whole time, withcountry: "Lithuania"sitting right there in the record._resolve_citymatched the query againstnamealone, exact-or-prefix — so the comma form could never match anything, and the country field was never consulted at all.The same exchange showed the two neighbouring failures:
Vilinus— one transposition — fell through to the same refusal, which reads as we've never heard of Vilnius rather than you typed it wrong.Tell me about weather in lithuaniawas quoted back verbatim as a city we don't track, which is what made it look broken rather than merely unmatched.What it does now
In descending order of confidence: exact name honouring a
City, Country/Regionqualifier → the same ignoring an unrecognised qualifier (better to grade Paris and name it in the reply than refuse over "Paris, Wherever") → prefix → close-enough name for typos → a city or country named somewhere inside a sentence, so "weather in lithuania" lands on Vilnius. Accents fold both ways, since people type Zurich and Sao Paulo far more often than Zürich and São Paulo.Free-text matching is whole-word and ignores names under four characters, so ordinary chatter doesn't become a weather report —
how are you todaystill resolves to nothing. The unmatched reply also stops reading a whole sentence back as a place name.This fixes
/gradeidentically — it shares the resolver and had the same bug.Verified
Against the exact strings from the report:
Tell me about weather in lithuaniaVilinus, LithuaniaVilnius, Lithuaniasan franZurich/Sao Paulohow are you todayFull backend suite: 416 passed, 8 skipped. Seven new regression tests, each named after a real failure.
Not covered
A typo inside a sentence (
whats it like in Toyko) still misses — fuzzy matching applies to the query as a whole, not per word, and loosening that invites false positives. The conversational agent handles that case; this is the always-on deterministic path.https://claude.ai/code/session_015Z1ebLbhUxeZ9ozpNrVTCP
1b862aa049to119c54604c