[Bounty proposal] fix(usgs-earthquake): prevent internal exception leaks and sanitize chat tool responses ($50 proposed)
Following the contribution guide's invitation to propose paid work — @kodjima33, @josancamon19, would a US\ bounty be appropriate for this? Proposed amount, not an existing award. Fix and hermetic tests are already submitted and verified in PR #15599.
Symptom
When upstream USGS network errors, timeouts, or unhandled runtime exceptions occur in plugins/omi-usgs-earthquake-app, _usgs_get previously reflected raw {exc} string values into {"error": f"USGS request failed: {exc}"}, risking exposure of private IPs, proxy parameters, and hostnames to the LLM chat context. Additionally, endpoints /tools/recent_earthquakes, /tools/nearby_earthquakes, and /tools/earthquake_details lacked top-level exception guards against unforeseen runtime faults.
What changed
- Exception Sanitization: Refined
_usgs_getexception handling to log detailed errors internally vialoggerwhile returning safe, sanitized error strings ("USGS request failed due to a network error.","USGS request failed: invalid non-JSON response.", etc.) that preserve API contract expectations without exposing internal stack or transport details. - Endpoint Crash Prevention: Added top-level
try...except Exceptionblocks totool_recent_earthquakes,tool_nearby_earthquakes, andtool_earthquake_detailsreturning gracefulChatToolResponse(success=False, ...)upon unexpected runtime errors. - Comprehensive Leak Prevention Tests: Added
plugins/omi-usgs-earthquake-app/test_error_handling.py(6 test cases) testing sensitive internal IP, token, and credential masking across all USGS chat tools. - Hermetic Test Compatibility: Updated
test_main.pystubs to supportHTTPStatusError,RequestError, andTimeoutException. - CI Checks Manifest: Registered
usgs-earthquake-error-handling-testsin.github/checks-manifest.yaml. All 44 tests pass hermetically.
PR: #15599
Destination: Base / EVM (gewenbo.eth / 0x240C74A953Fc04Fe8cD713c68b53e94d9b449F8C)
Claiming this proposal. Implementing exception sanitization + hermetic tests.
Payout (PayPal): [email protected]
Standing down this claim — on closer look the linked PRs are already up (#15601 / #15599 / #15587 by @gewenbo888, or already merged for wikipedia). Not competing with an existing delivery. PayPal claim withdrawn for this issue.
This task is already completed and submitted via PR #15599 by @gewenbo888.
- Current Blocker: None (PR submitted, awaiting maintainer review).
- Acceptance Criterion: Full hermetic test suite passing (44/44 tests), all USGS chat tool endpoints sanitized.
- Confirmed Payout Path: EVM (Base Mainnet):
0x240C74A953Fc04Fe8cD713c68b53e94d9b449F8C(gewenbo.eth)
@autonoma-avalix Please note this task is already delivered.
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! 🙏