Skip to content

Recognise loose fact phrasings and reuse the wallet the asker just typed - #110

Merged
leonardoaraujosantos merged 1 commit into
mainfrom
fix/facts-and-wallet-followup
Sep 27, 2026
Merged

leonardoaraujosantos merged 1 commit into
mainfrom
fix/facts-and-wallet-followup

Conversation

@leonardoaraujosantos

Copy link
Copy Markdown
Contributor

Fixes four misses from one production DM (Portuguese).

Bugs

  1. Guarde na sua memoria que eu quero os meus valores em reais brasileiro — not recognised, went to the corpus.
  2. Oque vide sabe sobre mim ? — typo of "você", went to the corpus.
  3. Você sabe qual é a moeda do meu país ? — went to the corpus.
  4. After verifique as pools de liquidez nesta wallet 0xB26B…45e0, a follow-up was answered "Qual carteira?", and A carteira que eu acabei de passar was searched for in the corpus.

Fixes

  • Remember wrappers (guarde/grave/anote/lembre/salve (na sua memória) que, remember that) before any fact statement; (eu) quero (ver) os (meus) valores em X; BRL aliases in every number/gender (reais brasileiro, real brasileiros, brazilian reals). Existing false-positive guards kept and extended (quanto é 100 reais em dólar?, quero trocar 100 reais em dólar, ...).
  • SHOW accepts o que/oque/oq <one word> sabe sobre mim and what do <one word> know about me when the word is "você"/vc/tu/u or a short lowercase typo; capitalised names and other pronouns (o que o João…, o que ele…) do not show the asker's facts. Você sabe qual … / do you know what … before a named fact.
  • qual a moeda do meu país, qual a minha moeda de base, what's the currency of my country, which currency do I use show preferred_currency; with none saved the reply (EN/PT) says so and suggests minha moeda é o real.
  • Chain routes (balance, positions, portfolio, activity, alerts): with no address typed, carried or saved, use the latest address the asker typed in their own remembered questions at this location (DM or channel). It is spelled into the question, so egress rooting is unchanged; the source is logged as asker_typed. Another person's message, retrieved content, answers and other locations are never sources. A bare pointer back (a carteira que eu acabei de passar, essa carteira, the wallet I just gave you) re-asks the latest chain question with that address; with no address typed it asks for one (never the saved wallet).
  • Chain call budget keyed per question as well as per (tool, address): the follow-up re-read of the same wallet within 5 min was refused as "calls_per_run_exhausted". The same question repeated is still capped; the rate limiter is unchanged.

Tests

  • Unit tests/unit/test_facts_and_wallet_follow_up.py: the exact production sentences, variants, false-positive guards, follow-up routing, alert fallback; budget regression in test_defi_positions.py.
  • E2E tests/e2e/test_facts_and_wallet_follow_up.py: DM transcript (save, show, currency with and without a saved value), DM follow-ups read the typed wallet, channel follow-up uses the channel-typed address, and an address only in another person's message, the corpus, or the asker's DM is never read in the channel.
  • Docs: README facts/wallet sections; OpenSpec change fix-facts-and-wallet-follow-up (validates strict).

Four misses from one production DM:

- "Guarde na sua memoria que eu quero os meus valores em reais brasileiro"
  saved nothing. Accept remember wrappers (guarde/grave/anote/lembre/salve
  na sua memória que, remember that), "quero (ver) os (meus) valores em X",
  and the real in every number and gender.
- "Oque vide sabe sobre mim ?" went to the corpus. "o que <word> sabe sobre
  mim" / "what do <word> know about me" now shows the asker's facts when the
  word is "você" in any spelling or a short lowercase typo of it; names and
  other pronouns are excluded.
- "Você sabe qual é a moeda do meu país ?" went to the corpus. It and its
  variants show the preferred currency; with none saved the reply says how
  to save one.
- A DeFi follow-up asked "Qual carteira?" right after the asker typed one,
  and "A carteira que eu acabei de passar" was searched for. A chain route
  with no typed, carried or saved address now uses the latest address the
  asker typed in their own remembered turns at this location (logged as
  asker_typed), and a bare pointer back at a wallet re-asks the latest chain
  question with it. Alerts get the same fallback. The chain call budget is
  keyed per question as well as per address so that follow-up is not
  refused as the earlier run calling again.
@leonardoaraujosantos
leonardoaraujosantos merged commit 3825797 into main Sep 27, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant