Skip to content

[Bounty proposal] fix(retrieval-tools): sanitize unexpected exceptions across external and app tools #19407

Closed as not planned

Description

@naufalfx805-source

Bounty Proposal Description

Internal runtime exceptions across external retrieval tools (perplexity_tools, web_tools, graph_tools, and app_tools) were previously returning raw exception messages directly to the chat conversation and LLM context via f"Error: ... {e}" or f"Error: ... {str(e)}".

This exposes internal infrastructure stack traces, network socket errors, auth headers, and backend database connection details to end users.

Proposed Changes

  1. backend/utils/retrieval/tools/perplexity_tools.py: Sanitize unexpected runtime exceptions during Perplexity gateway searches.
  2. backend/utils/retrieval/tools/web_tools.py: Sanitize unhandled exceptions in fetch_url_tool.
  3. backend/utils/retrieval/tools/graph_tools.py: Sanitize unhandled exceptions in traverse_knowledge_graph_tool.
  4. backend/utils/retrieval/tools/app_tools.py: Sanitize unhandled exceptions in MCP tool invocation and HTTP app tool endpoint calls.
  5. In all modified modules, add exc_info=True to logger.error so errors are preserved with full stack traces in server logs without leaking to users.
  6. Added hermetic test suite in backend/tests/unit/test_external_tools_sanitization.py (5/5 PASS).

Implementation PR

Bounty Payout

  • Amount Requested: $50 USDC
  • Network: Base Mainnet
  • EVM Wallet Address: 0x496e32ff3851cdb9146223a811e3d4f9218dd954

Activity

  1. added
    intelligence
    p2
    retrieval-action
    p3
    and removed
    intelligence
    p2
    on Oct 6, 2026
  2. undivisible commented on Oct 22, 2026

    @undivisible
    Collaborator

    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! 🙏

  3. moved this from Someday to In review in omi TODO / bountieson Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    p3retrieval-action

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions