Record Anthropic server tool blocks as tool call parts #2642
All Vouch review confidence checks passed
Residual risk 0.25 = Change Risk (0.46) × (1 − Review Confidence (0.45)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.46 · 249 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.330
Real PR Conversation Timeline
1 comments
"Review active on #2642"
general
weight: 0.35
pcbeingused333
convert_response_to_semconvhandled text andtool_useblocks and dumped every other block as a raw dict. Server-side tools (web search, web fetch, code execution, ...) therefore showed up ingen_ai.output.messagesasserver_tool_useandweb_search_tool_resultdicts instead of message parts, and the same happened to those blocks in an assistant message sent back as input.A
server_tool_useblock is now atool_callpart and a*_tool_resultblock (anything that carries atool_use_id) atool_call_responsepart, converted from the SDK models to plain data. The streamed response goes through the same conversion.Parts for server tools reuse
tool_callandtool_call_response, since the semconv module here has no separate server-tool part; happy to switch if you'd rather have one. The result content is passed through as plain data, including theencrypted_contentof web search results, exactly what the raw block dump already carried; dropping that field to keep spans smaller is a one-line change if you prefer. Tests use the SDK's ownServerToolUseBlock,WebSearchToolResultBlockandWebSearchResultBlockfor a response, and dicts for the input side; they fail onmain.This change was made with Claude Code (AI-assisted); the tests above were run, but no request was made to the Anthropic API.
🤖 Generated with Claude Code
<!-- This is an auto-generated description by cubic. -->
<a href="https://cubic.dev/pr/pydantic/logfire/pull/2642?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="View guided diff" src="https://www.cubic.dev/buttons/review-in-cubic-light.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->