Preserve snapshots when resuming response streams#1984
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d0bf5e75bf
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
updated this in |
|
Thanks, this version looks right to me. I pulled
Both pass. The new regression is a better fit than my original URL-only test since it checks the truncated replay case directly. |
Problem
responses.stream({ response_id, starting_after })needs the replayed event prefix to build complete event snapshots andfinalResponse(). Passingstarting_afterthrough toresponses.retrievemakes the API omit that prefix, includingresponse.created, so the accumulator can fail before yielding resumed events.Fix
starting_afterdocs so the snapshot-building behavior is explicit.Test
pnpm test tests/lib/ResponseStream.test.tspnpm lintRelated to #1983.