Skip to content

fix(anthropic): preserve thinking blocks in output spans#2086

Draft
chocoHacks33 wants to merge 1 commit into
pydantic:mainfrom
chocoHacks33:agent/anthropic-thinking-reasoning
Draft

fix(anthropic): preserve thinking blocks in output spans#2086
chocoHacks33 wants to merge 1 commit into
pydantic:mainfrom
chocoHacks33:agent/anthropic-thinking-reasoning

Conversation

@chocoHacks33

@chocoHacks33 chocoHacks33 commented Jul 19, 2026

Copy link
Copy Markdown

Summary

  • map Anthropic thinking / beta thinking blocks to Logfire semconv reasoning parts
  • preserve Anthropic thinking content in legacy response_data.message for the default instrumentation path
  • add regression coverage for both the semconv conversion helper and legacy response payload

Why

Fixes the missing Anthropic thinking-block capture behind issue #1737, where extended/interleaved thinking content was not preserved cleanly in Logfire's output span data.

Validation

  • direct Python smoke check for convert_response_to_semconv(...) and on_response(..., version=1) with ThinkingBlock
  • git diff --check

Environment limits

  • pytest tests/otel_integrations/test_anthropic.py ... is currently blocked in this environment by an import-time PendingDeprecationWarning from the MCP test bootstrap (python_multipart / multipart)
  • python -m compileall ... hit local OSError: [Errno 28] No space left on device

Review in cubic

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.

1 participant