From 84f4108195fb516d48745aa912ba8862c7360ebb Mon Sep 17 00:00:00 2001 From: Ahmed Allam Date: Sun, 13 Sep 2026 16:31:08 +0000 Subject: [PATCH] fix(web_search): send only the agent's query to Exa search Exa /search is a neural search endpoint, not a chat model, so prepending the Perplexity system prompt made Exa match the prompt's own vocabulary (Kali, OWASP, apt, NIST) instead of the query. The system prompt stays on the Perplexity path where it is a chat system message; the Exa summary instruction is unchanged. --- strix/tools/web_search/tool.py | 2 +- tests/test_web_search.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/strix/tools/web_search/tool.py b/strix/tools/web_search/tool.py index 9f1c4910..f525b1ea 100644 --- a/strix/tools/web_search/tool.py +++ b/strix/tools/web_search/tool.py @@ -121,7 +121,7 @@ def _exa_content(api_key: str, query: str, search_type: str, num_results: int) - api_key, "https://api.exa.ai/search", { - "query": f"{_SYSTEM_PROMPT}\n\n{query}", + "query": query, "type": search_type, "numResults": num_results, "contents": {"summary": {"query": _EXA_SUMMARY_PROMPT}}, diff --git a/tests/test_web_search.py b/tests/test_web_search.py index 7ec066b9..6aff26ba 100644 --- a/tests/test_web_search.py +++ b/tests/test_web_search.py @@ -110,7 +110,7 @@ def test_exa_content_requests_summaries_and_renders_results( assert captured["url"] == "https://api.exa.ai/search" assert captured["headers"]["x-api-key"] == "ek" - assert "OpenSSH 7.4 RCE?" in captured["json"]["query"] + assert captured["json"]["query"] == "OpenSSH 7.4 RCE?" assert captured["json"]["type"] == "auto" assert captured["json"]["numResults"] == 5 assert captured["json"]["contents"] == {"summary": {"query": tool._EXA_SUMMARY_PROMPT}}