Conversation
| func TestResponsesIncompleteStreaming(t *testing.T) { | ||
| rt, exporter := newTestResponsesTracer(t) | ||
|
|
||
| sseBody := `event: response.output_text.delta |
Contributor
There was a problem hiding this comment.
i think rather than having a strict unit test for parsing the SSE stream, we should try to make a real request to the server (using VCR, etc) that reveals this test (e.g. with a very low max tokens). Look at the other tests to see the pattern to follow.
| @@ -181,6 +180,7 @@ func (rt *responsesTracer) handleResponseCompletedMessage(span trace.Span, rawMs | |||
| metadataFields := []string{ | |||
There was a problem hiding this comment.
now that we are collecting response.incomplete, I think should add incomplete_details as a field here as well.
| // parse the other messages too? | ||
| if msgType == "response.completed" { | ||
| switch msgType { | ||
| case "response.completed", "response.failed", "response.incomplete": |
There was a problem hiding this comment.
For the response.failed case, can we capture the error somehow?
…ration tests in favor of unit tests
Abhijeet Prasad (AbhiPrasad)
approved these changes
Apr 28, 2026
Matt Perpick (clutchski)
approved these changes
Apr 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously, the streaming response parser only processed response.completed events, silently dropping terminal events for truncated or failed responses. This meant that when a streaming call hit max_output_tokens or encountered a server error, no span metadata was recorded.
Changes:
Resolves #115