
- Tanga
- AI
- Mantiq
- Testlar
Which savings goal?
101
A question from real use: if I have several savings goals and write "moved 1 million to the car fund" or "took 2 million out of the car savings", how does the bot know which goal I mean?
I traced it and found five problems. The goal name was extracted only for deposits, so withdrawals always came out of the main goal. Matching ignored words shorter than three letters, so a goal called "Uy" (house) could never be found. A filler word like "uchun" (for) matched whichever goal happened to come first. Russian case endings broke the match: "квартиру" didn't find "Квартира". And the reply always showed the main goal's progress, so the mistake stayed invisible.
Now, when there are two or more goals, the AI receives their names and returns one of them exactly. The list goes into the user part of the prompt, so the cached system prompt doesn't change. Matching understands Uzbek suffixes and Russian endings and skips filler words. If the name is still ambiguous, the money goes to the main goal and the bot asks which one it belongs to, with a button per goal. Every savings entry also got a "change goal" button.
25 new tests cover these cases; for users with a single goal nothing changed.
Takeaway: test the second goal, not just the first. Most of these bugs only appeared when there was a choice.