Skip to content

feat: replay a recorded response, starting with the Responses API - #12

Merged
chrikrah merged 1 commit into
mainfrom
feat/replay-recorded-fixture
Oct 12, 2026
Merged

chrikrah merged 1 commit into
mainfrom
feat/replay-recorded-fixture

Conversation

@chrikrah

Copy link
Copy Markdown
Contributor

Replays a recorded provider stream as a scenario. The first one is the first OpenAI Responses API scenario: kartsan03/wiretruth's stream.missing-finish-abort, vendored unchanged with its derived_from block and MIT notice. It holds eight recorded events, and then the connection drops.

It also fixes the fake provider. When drop_after equalled the number of events, it ended the stream cleanly instead of dropping the connection.

$ uv run pytest -q -m "not slow"
147 passed, 2 deselected
$ uv run pytest -q -m slow          # both controls, end to end
2 passed, 147 deselected
$ uv run spantruth run --scenario openai/responses-stream-missing-finish-abort --scenario openai/stream-dropped
| Scenario                                     | openinference | openllmetry | otel-official |
| openai/responses-stream-missing-finish-abort | pass          | pass        | pass          |
| openai/stream-dropped                        | pass          | wrong       | pass          |

All three libraries end the Responses span with an error. OpenLLMetry 0.62.4 still leaves the Chat Completions span OK on the same failure (traceloop/openllmetry#4535).

Fixes #11

A scenario can now come from a recorded provider stream in kartsan03/wiretruth's
wiretruth.fixture/v1 format, not only from code. The first is
openai/responses-stream-missing-finish-abort, vendored unchanged with its
derived_from block and the MIT notice: eight Responses API events, then the
connection drops. It is also the first Responses API scenario, so the app
calls client.responses.create and the reference instrumentation covers it.

The fake provider never dropped a connection when drop_after equalled the
event count: the loop ended first and sent a clean end of stream. A recorded
abort cuts after its last frame, so the drop now happens after the loop.

Fixes #11
@chrikrah
chrikrah merged commit 6ddfa8a into main Oct 12, 2026
8 checks passed
@chrikrah
chrikrah deleted the feat/replay-recorded-fixture branch October 12, 2026 21:51
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.

Replay a recorded body: start the Responses API with kartsan03/wiretruth's missing-finish-abort fixture

1 participant