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_<hex> not msg_<hex>-<hex>-...)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
0xxmemo 2026-04-06 16:33:36 -05:00
parent 5d54adf2de
commit 573b02a35f

View file

@ -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,