Skip to content

fix(anthropic): classify server tool message parts - #699

Open
lmolkova wants to merge 5 commits into
open-telemetry:mainfrom
lmolkova:fix-anthropic-server-tool-parts
Open

fix(anthropic): classify server tool message parts#699
lmolkova wants to merge 5 commits into
open-telemetry:mainfrom
lmolkova:fix-anthropic-server-tool-parts

Conversation

@lmolkova

Copy link
Copy Markdown
Member

Fixes Anthropic server tool calls and results being captured as client-side tool parts.

Anthropic-executed tools now use ServerToolCallPart and ServerToolCallResponsePart for response objects and replayed dictionary content. Current stable server-result variants are supported without importing version-specific SDK classes.

Known gap: beta message blocks remain scoped to #661.

@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Sep 12, 2026

Copy link
Copy Markdown

Pull request dashboard status

Waiting on the author · refreshed 2026-09-12 20:12 UTC

Move out of draft to request review.

Status above doesn't look right?
  • Just replied or pushed? Anything around or after the refresh time above may not be picked up yet — give it a few minutes.
  • Anything look wrong? Report it with what you expected; it helps us improve the dashboard.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The implementation covers stable Anthropic server-tool variants and includes focused unit and conformance validation.

Pull request overview

Corrects Anthropic telemetry so provider-executed tools use server-tool message parts.

Changes:

  • Converts stable server-tool calls/results from SDK objects and dictionaries.
  • Adds unit and conformance coverage.
  • Adds a changelog fragment.
File summaries
File Description
utils.py Maps server-tool blocks to semantic-convention parts.
test_messages_extractors.py Tests object and dictionary conversion.
server_tool_calling.py Adds server-tool conformance scenario.
test_conformance.py Registers the new scenario.
server_tool_calling_conformance.yaml Provides recorded API response data.
.changelog/699.fixed Documents the correction.
Review details
  • Files reviewed: 6/6 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@lmolkova
lmolkova marked this pull request as ready for review September 12, 2026 20:31
@lmolkova
lmolkova requested a review from a team as a code owner September 12, 2026 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants