fix: resume Responses streams from server-side cursors - #548
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Castiron custom code✅ No new custom-code files detected. 47 mixed files remain; 1 existing customization changed. Compared
46 existing customizations unchanged
6 more in the full report. A changed generated baseline means this report cannot reliably identify which handwritten lines changed. Inspect the custom-code diffDownload the exact patch produced by this run (requires repository access): gh run download 33223045372 --repo openai/openai-ruby \
--name castiron-custom-code-33223045372-1 --dir /tmp/castiron-custom-code-33223045372-1
git apply --stat /tmp/castiron-custom-code-33223045372-1/custom-code.patch
cat /tmp/castiron-custom-code-33223045372-1/custom-code.patchOr reproduce it from an SDK checkout containing the vendored reporter: git fetch --no-tags origin da421b507c24c35f62ff8679dd5c468ce8a0dab9 d0aad51d7bf351667e5df16e2d079d077c1e0f8d
python3 scripts/castiron/custom_code_report.py report \
--base da421b507c24c35f62ff8679dd5c468ce8a0dab9 \
--head d0aad51d7bf351667e5df16e2d079d077c1e0f8d --fetch --require-head-hash --public \
--out /tmp/castiron-custom-code-d0aad51d7bf3
cat /tmp/castiron-custom-code-d0aad51d7bf3/custom-code.patchThis is the current full custom patch for mixed files, not an attribution of only the handwritten lines changed by this PR. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 21a88e4205
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
jbeckwith-oai
left a comment
There was a problem hiding this comment.
Re-reviewed the exact current head. starting_after is forwarded to the retrieval stream, resumed streams no longer require a synthetic response.created, raw deltas avoid quadratic prefix materialization, and authoritative done/completed events still drive parsed/final results. No blocking findings. (GitHub does not permit this account to formally approve its own PR.)
HAYDEN-OAI
left a comment
There was a problem hiding this comment.
Reviewed the full diff at 8b8f54b1f1b2240faca2a20bbc16c975255a8fee, including cursor forwarding, partial-stream handling, structured completion, unknown events, and stream cleanup. The previous quadratic-copy concern is addressed, but one helper-event compatibility regression remains inline.
HAYDEN-OAI
left a comment
There was a problem hiding this comment.
Reviewed the full current diff at 439c5f654bf439deeead263173a6b5034c722da9. The prior helper-event compatibility issue is fixed for both text and function-argument deltas: partial resumes retain the public helper subclasses and original payload fields, with snapshot: nil representing the unavailable prefix without rebuilding it. Cursor forwarding now also uses normalized parameters while preserving request options. Completion/structured-output handling, unknown-event filtering, normal-stream validation, and stream cleanup remain consistent. No substantive issues found.
Summary
starting_afterwhenclient.responses.stream(response_id:, starting_after:)retrieves an existing response, so the server resumes from the requested event sequence.response.completed, while preserving normal stream validation and typed final responses.Verification
TMPDIR=/private/tmp bundle exec rake testBUNDLE_FROZEN=true BUNDLE_GEMFILE=gemfiles/bedrock.gemfile bundle exec rake test:bedrockbundle exec rake lint:rubocopbundle exec rake typecheck:sorbetbundle exec rake validate:rbspython3 -m unittest discover -s scripts/castiron -p 'test_custom_code*.py'@openai/sdks-team