Skip to content

fix(anthropic): preserve partial output when message streams fail - #793

Draft
girishkvs wants to merge 2 commits into
open-telemetry:mainfrom
girishkvs:anthropic_partial_output
Draft

girishkvs wants to merge 2 commits into
open-telemetry:mainfrom
girishkvs:anthropic_partial_output

Conversation

@girishkvs

Copy link
Copy Markdown

Summary

Preserve already-received Anthropic response content when a message stream fails, including text_stream snapshots. Keep the original exception, existing capture policy and single finalization; do not synthesize output or a finish reason when the provider supplied none.

Validation

  • Same-environment before/after checks distinguish missing partial output from the five historical localhost cases.
  • Python 3.10: 305 passed / 7 existing skips with SDK 0.51.0; 312 passed with SDK 1.6.0.
  • Python 3.14 / SDK 1.5.0: 312 passed on current main 14c76fee plus this patch.
  • Whole-repository typecheck: zero errors/warnings. Declared conformance: 7 replay scenarios passed.
  • Full precommit: all five hooks passed; the run left the canonical lock and reviewed source unchanged.
  • No live provider calls or new recordings.

Known gaps

Historical Windows timeout differences remain unexplained. The Linux baseline and patched runs pass those localhost cases without changing their assertions.

The related clarification in open-telemetry/semantic-conventions-genai#459 is still proposed. No schema or beta API implementation is included here.

Preserve response content received before a stream fails.
Keep the original exception, capture policy and single finalization.
Do not synthesize output or a finish reason that was never received.
@opentelemetry-pr-dashboard

Copy link
Copy Markdown

Pull request dashboard status

Waiting on the author · refreshed 2026-09-25 08:36 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.

This branch has not been deployed

No deployments
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