From 573b02a35f3bef1d870e60f82b756caca5927dcc Mon Sep 17 00:00:00 2001 From: 0xxmemo Date: Mon, 6 Apr 2026 16:33:36 -0500 Subject: [PATCH] Fix review feedback: encrypted_content and message ID format - Put snippet text in encrypted_content so the model can read page content from search results (empty string meant the model only saw titles/URLs) - Strip hyphens from synthetic message ID to match Anthropic's compact alphanumeric format (msg_ not msg_--...) Co-Authored-By: Claude Opus 4.6 --- litellm/integrations/websearch_interception/handler.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/litellm/integrations/websearch_interception/handler.py b/litellm/integrations/websearch_interception/handler.py index f72244a1e8a..4eb3571d5e9 100644 --- a/litellm/integrations/websearch_interception/handler.py +++ b/litellm/integrations/websearch_interception/handler.py @@ -174,11 +174,9 @@ class WebSearchInterceptionLogger(CustomLogger): "type": "web_search_result", "url": url, "title": title or url, - "encrypted_content": "", + "encrypted_content": snippet or "", "page_age": None, } - if snippet: - hit["snippet"] = snippet search_hits.append(hit) tool_use_id = f"srvtoolu_{str(uuid.uuid4()).replace('-', '')[:24]}" @@ -204,7 +202,7 @@ class WebSearchInterceptionLogger(CustomLogger): ] response: Dict[str, Any] = { - "id": f"msg_{str(uuid.uuid4())}", + "id": f"msg_{str(uuid.uuid4()).replace('-', '')[:20]}", "type": "message", "role": "assistant", "model": model,