You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bounty proposal] fix(retrieval-tools): sanitize unexpected exceptions across external and app tools #19407
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
backend/utils/retrieval/tools/perplexity_tools.py: Sanitize unexpected runtime exceptions during Perplexity gateway searches.
backend/utils/retrieval/tools/web_tools.py: Sanitize unhandled exceptions in fetch_url_tool.
backend/utils/retrieval/tools/graph_tools.py: Sanitize unhandled exceptions in traverse_knowledge_graph_tool.
backend/utils/retrieval/tools/app_tools.py: Sanitize unhandled exceptions in MCP tool invocation and HTTP app tool endpoint calls.
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.
Added hermetic test suite in backend/tests/unit/test_external_tools_sanitization.py (5/5 PASS).
Activity
undivisible commentedon Oct 22, 2026
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! 🙏