Summary
Anthropic's extended thinking is a stable, prominently documented feature that adds thinking content blocks (non-streaming) and thinking_delta stream events (streaming) to responses. This repo's Anthropic instrumentation does not capture thinking content in either the wrapper or the auto-instrumentation plugin, and the vendor SDK types do not model thinking blocks or deltas at all.
What is missing
Vendor types (js/src/vendor-sdk-types/anthropic.ts)
AnthropicOutputContentBlock (line 85–93) does not include { type: "thinking"; thinking: string }.
AnthropicStreamEvent's content_block_delta union (lines 112–114) does not include { type: "thinking_delta"; thinking: string }.
AnthropicUsage (lines 95–100) does not include thinking-related token fields (input_tokens for thinking cache, etc.).
Wrapper streaming (js/src/wrappers/anthropic.ts)
streamNextProxy handles text_delta and input_json_delta in content_block_delta events (lines 343–353) but has no case for thinking_delta.
- When a
thinking block streams, content_block_start saves the block, but no delta text is accumulated. At content_block_stop, text is empty so nothing is logged (line 359: if (!text) break).
- Thinking content is silently dropped from the span output.
Auto-instrumentation plugin (js/src/instrumentation/plugins/anthropic-plugin.ts)
aggregateAnthropicStreamChunks (lines 138–198) only handles text_delta in the content_block_delta case (line 161). thinking_delta events are ignored.
Non-streaming
parseEventFromMessage returns { role: message.role, content: message.content }, so thinking blocks would be passed through if the actual SDK returns them. However, the vendor types don't model them, so TypeScript consumers lose type safety.
Upstream reference
Braintrust docs status
Braintrust Anthropic integration docs mention streaming and metric collection but do not mention extended thinking (not_found).
Local files inspected
js/src/vendor-sdk-types/anthropic.ts
js/src/wrappers/anthropic.ts
js/src/instrumentation/plugins/anthropic-plugin.ts
js/src/instrumentation/plugins/anthropic-channels.ts
e2e/scenarios/anthropic-auto-instrumentation-node-hook/ (no thinking test cases)
e2e/scenarios/wrap-anthropic-message-traces/ (no thinking test cases)
Summary
Anthropic's extended thinking is a stable, prominently documented feature that adds
thinkingcontent blocks (non-streaming) andthinking_deltastream events (streaming) to responses. This repo's Anthropic instrumentation does not capture thinking content in either the wrapper or the auto-instrumentation plugin, and the vendor SDK types do not model thinking blocks or deltas at all.What is missing
Vendor types (
js/src/vendor-sdk-types/anthropic.ts)AnthropicOutputContentBlock(line 85–93) does not include{ type: "thinking"; thinking: string }.AnthropicStreamEvent'scontent_block_deltaunion (lines 112–114) does not include{ type: "thinking_delta"; thinking: string }.AnthropicUsage(lines 95–100) does not include thinking-related token fields (input_tokensfor thinking cache, etc.).Wrapper streaming (
js/src/wrappers/anthropic.ts)streamNextProxyhandlestext_deltaandinput_json_deltaincontent_block_deltaevents (lines 343–353) but has no case forthinking_delta.thinkingblock streams,content_block_startsaves the block, but no delta text is accumulated. Atcontent_block_stop, text is empty so nothing is logged (line 359:if (!text) break).Auto-instrumentation plugin (
js/src/instrumentation/plugins/anthropic-plugin.ts)aggregateAnthropicStreamChunks(lines 138–198) only handlestext_deltain thecontent_block_deltacase (line 161).thinking_deltaevents are ignored.Non-streaming
parseEventFromMessagereturns{ role: message.role, content: message.content }, so thinking blocks would be passed through if the actual SDK returns them. However, the vendor types don't model them, so TypeScript consumers lose type safety.Upstream reference
@anthropic-ai/sdkstreaming format includesthinking_deltaevents: https://github.com/anthropics/anthropic-sdk-typescript/blob/main/helpers.mdthinking: { type: "enabled", budget_tokens: N }.content_block_startwithtype: "thinking", followed bycontent_block_deltawithdelta.type: "thinking_delta"anddelta.thinkingfield.Braintrust docs status
Braintrust Anthropic integration docs mention streaming and metric collection but do not mention extended thinking (
not_found).Local files inspected
js/src/vendor-sdk-types/anthropic.tsjs/src/wrappers/anthropic.tsjs/src/instrumentation/plugins/anthropic-plugin.tsjs/src/instrumentation/plugins/anthropic-channels.tse2e/scenarios/anthropic-auto-instrumentation-node-hook/(no thinking test cases)e2e/scenarios/wrap-anthropic-message-traces/(no thinking test cases)