omi icon indicating copy to clipboard operation
omi copied to clipboard

[Bounty proposal] fix(omi-frankfurter-app): null optional params + single-string targets (US$25 proposed)

Open kduailabs opened this issue 2 months ago • 4 comments

Summary

plugins/omi-frankfurter-app rejects valid tool calls that chat runners produce:

  1. get_latest_rates documents to_currencies as optional (required: ["base_currency"] in the tool manifest), but a JSON null — the value runners send for unprovided optional parameters — fails Pydantic validation even though the field has a default. The documented default (all currencies) is unreachable for null.
  2. A bare-string target is rejected. to_currencies: "eur" fails for both tools although it is unambiguous; runners sometimes collapse single-element lists to a string.
  3. Non-string entries raise AttributeError inside _normalize_currency_code instead of a clean validation error.

Fix

PR #14622 (open):

  • _coerce_currency_list(values, *, allow_null): accepts a single string or a list, dedupes and normalizes codes; null takes the default only where the field is optional.
  • LatestRatesRequest.to_currencies: null -> [] (all currencies), single string -> one-item list.
  • ConvertCurrencyRequest.to_currencies: single string -> one-item list; null stays rejected (required field) with a clean validation error.
  • _normalize_currency_code rejects non-string input with ValueError.
  • All validators moved to mode="before"; hermetic harness upgraded to execute them, +8 regression tests.

Verification

$ python3 -S test_main.py
Ran 32 tests in 0.016s
OK

Real-pydantic check (production versions):

latest null to_currencies -> [] | base: USD
latest single string -> ['EUR']
convert null targets -> rejected: ValidationError
convert dedupe -> ['EUR', 'GBP']
convert bad entry -> rejected: ValidationError

Bounty

Per the contribution guide ("No bounties available? … suggest your own"), proposing a US$25 bounty for this fix + regression tests. cc @josancamon19 @kodjima33

AI-assisted disclosure: produced by an AI agent running locally on the account holder's machine, reviewed by the account holder, who takes responsibility for it.

kduailabs avatar Sep 19 '26 01:09 kduailabs

Fix is open as PR #14622 — no competing PR exists on this bug.

kduailabs avatar Sep 19 '26 01:09 kduailabs

The two failure modes are clear: to_currencies: null bypassing the default despite not being in required, and bare string inputs like "eur" failing list validation. I'd handle both with a field validator that coerces null to the default and wraps a string in a list before Pydantic processes it. Want to take this on.

Nordikdata avatar Sep 19 '26 06:09 Nordikdata

Thanks @Nordikdata — this one is already claimed: the fix is open as PR #14622 (validators coerce null to the documented default, wrap bare strings like "eur" in a list, and reject malformed entries cleanly; 8 regression tests + full suite passing, mergeable). To avoid a duplicate PR, best to pick another open bounty. Happy to take review feedback here on #14622.

kduailabs avatar Sep 19 '26 06:09 kduailabs

Closing as already fixed on current main.

Merged #14622; current main plugins/omi-frankfurter-app/_coerce_currency_list handles null + single-string targets

aryanorastar avatar Sep 20 '26 16:09 aryanorastar