omi icon indicating copy to clipboard operation
omi copied to clipboard

[Bounty proposal] fix(chart-tools): harden create_chart_tool input validation, numeric coercion, and configurable resilience ( proposed)

Open ghazy2001 opened this issue 1 month ago • 2 comments

Bounty Proposal: Chart Tools Resilience & Formatting Hardening ($50 USD)

Pull Request: https://github.com/BasedHardware/omi/pull/23286 Target Maintainers: @kodjima33 @Git-on-my-level @josancamon19

Description

Hardens backend/utils/retrieval/tools/chart_tools.py against edge cases and runtime crashes when generating inline chat visualizations:

  1. Guards labels and values against None and non-list structures, eliminating unhandled TypeError crashes.
  2. Normalizes chart_type with case-insensitive trimming ("Line" / "BAR" -> "line" / "bar").
  3. Coerces numeric values to float and validates against NaN/Inf to prevent client-side chart crashes.
  4. Hardens configurable assignment when config.get('configurable') returns None.
  5. Adds 10 hermetic unit tests (10/10 passing) in backend/tests/unit/test_chart_tools.py.

Settlement Details

  • Proposed Bounty: $50 USD
  • Contractor / Payment: Available for backend & tool engineering contracts ([email protected]).

ghazy2001 avatar Oct 22 '26 11:10 ghazy2001

Solved in PR #23816 (https://github.com/BasedHardware/omi/pull/23816).

Changes

  • Hardened create_chart_tool against missing 'configurable' keys and None values, ensuring configurable dictionary is reliably bound into config before assigning chart_data.
  • Defensively coerced data point labels to strings and values to floats with safe fallbacks.
  • Added comprehensive hermetic test suite in ackend/tests/unit/test_chart_tools.py (5/5 passing).

Payout Details

  • Wallet: 0xC345C07229307d4f1c7935aD2cAe48e390215808
  • Network: Polygon / Base / Arbitrum / Stellar

Dimank92 avatar Oct 27 '26 16:10 Dimank92

Thanks for putting this together. We aren't doing bounties at the moment, so we're closing the bounty proposal issues for now — thanks for the fix! 🙏

aryanorastar avatar Oct 31 '26 06:10 aryanorastar