omi
omi copied to clipboard
[Bounty proposal] fix(chart-tools): harden create_chart_tool input validation, numeric coercion, and configurable resilience ( proposed)
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:
- Guards
labelsandvaluesagainstNoneand non-list structures, eliminating unhandledTypeErrorcrashes. - Normalizes
chart_typewith case-insensitive trimming ("Line"/"BAR"->"line"/"bar"). - Coerces numeric values to float and validates against
NaN/Infto prevent client-side chart crashes. - Hardens
configurableassignment whenconfig.get('configurable')returnsNone. - 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]).
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
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! 🙏