Skip to content

feat(anthropic): Record reasoning parts in streaming output - #8193

Merged
alexander-alderman-webb merged 10 commits into
masterfrom
webb/anthropic/streaming-reasoning
Nov 5, 2026
Merged

alexander-alderman-webb merged 10 commits into
masterfrom
webb/anthropic/streaming-reasoning

Conversation

@alexander-alderman-webb

@alexander-alderman-webb alexander-alderman-webb commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Accumulate thinking output in the same format as the nonstreaming path so _set_output_data() can format the thinking parts as reasoning parts that the product understands.

Issues

Reminders

@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Coverage Results 📊

✅ 137214 passed | ⏭️ 7456 skipped | Total: 144670 | Pass Rate: 94.85% | Execution Time: 453m 42s

📊 Comparison with Base Branch

Metric Change
Total Tests —
Passed Tests —
Failed Tests —
Skipped Tests —

✨ Test counts unchanged from base.

All tests are passing successfully.

✅ Patch coverage is 93.75% (15 of 16 changed executable lines covered; target 80%).
Project statement coverage is 90.29% (unchanged from base (7b1b1cb) to head (09070aa)).

Changed files with executable lines (1)
File Patch coverage Changed executable lines
sentry_sdk/integrations/anthropic.py 93.75% 15/16 covered; missed: 391; partial branches: 388
Coverage diff
@@            Coverage Diff             @@
##        master     #8193       +/-##
==========================================
  Coverage    90.29%    90.29%        —%
==========================================
  Files          203       203         —
  Tracked lines     26910     26922       +12
  Branches     10050     10056        +6
==========================================
+ Hits         24298     24309       +11
- Misses        2612      2613        +1
- Partials      1518      1519        +1

Generated by Coverage Action

@alexander-alderman-webb
alexander-alderman-webb force-pushed the webb/anthropic/streaming-reasoning branch from 4f7812f to 510b381 Compare November 5, 2026 08:46
@alexander-alderman-webb
alexander-alderman-webb force-pushed the webb/anthropic/streaming-reasoning branch from 3bc6734 to 09b45de Compare November 5, 2026 09:46
…ntry/sentry-python into webb/anthropic/streaming-reasoning
@alexander-alderman-webb
alexander-alderman-webb force-pushed the webb/anthropic/streaming-reasoning branch from 09b45de to dcfcd0c Compare November 5, 2026 09:54
delta = event.delta
if ThinkingDelta is not None and isinstance(delta, ThinkingDelta):
content_blocks[-1]["thinking"] += delta.thinking
elif hasattr(event.delta, "text"):

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The hasattr() and getattr() are leftovers from existing code, and new stuff uses types.

@alexander-alderman-webb
alexander-alderman-webb force-pushed the webb/anthropic/streaming-reasoning branch from 7dce4f1 to 77eebbe Compare November 5, 2026 10:10
@alexander-alderman-webb
alexander-alderman-webb marked this pull request as ready for review November 5, 2026 10:12
@alexander-alderman-webb
alexander-alderman-webb requested a review from a team as a code owner November 5, 2026 10:12
Comment thread sentry_sdk/integrations/anthropic.py Resolved

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

@alexander-alderman-webb
alexander-alderman-webb force-pushed the webb/anthropic/streaming-reasoning branch from 77eebbe to fc69b80 Compare November 5, 2026 10:31

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

Comment thread sentry_sdk/integrations/anthropic.py Resolved
@alexander-alderman-webb
alexander-alderman-webb force-pushed the webb/anthropic/streaming-reasoning branch from d0e76af to 02923b0 Compare November 5, 2026 11:55

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 02923b0. Configure here.

Comment thread sentry_sdk/integrations/anthropic.py Resolved
@alexander-alderman-webb
alexander-alderman-webb force-pushed the webb/anthropic/streaming-reasoning branch from 02923b0 to 1356704 Compare November 5, 2026 12:17
Base automatically changed from webb/anthropic/reasoning to master November 5, 2026 14:06
@alexander-alderman-webb
alexander-alderman-webb merged commit 28d4c31 into master Nov 5, 2026
172 checks passed
@alexander-alderman-webb
alexander-alderman-webb deleted the webb/anthropic/streaming-reasoning branch November 5, 2026 14:20
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