Repository navigation
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. |
|
@codex review |
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
Hi maintainers, a quick follow-up on this PR: the Static analysis, Python Tests, and Examples Integration Test workflows are marked as failed, but the Actions API returns no jobs for any of the three runs. Since the PR was opened on October 30 and the failure notifications arrived on November 29, I suspect the fork workflow approval may have expired rather than the tests themselves failing. Could you please confirm whether that is the case and approve or retrigger the workflows when you have a chance? The PR remains open and mergeable, and the original local verification (495 unit tests passed, 1 existing skip) is documented in the description. Happy to address any issues once CI runs. Thanks! |
📥 Pull Request
📘 Description
When an OpenAI synchronous chat stream raises during iteration,
OpenaiStreamWrapper.__next__propagates the exception but leaves its span recording and attached. The failed call is not exported, and subsequent operations can inherit it as their parent.Record the exception and ERROR status before re-raising, and share idempotent span/context cleanup across iteration failure, normal exhaustion and context-manager exit. This also prevents repeated
end()and context detachment when an exhausted stream exits awithblock. An ended wrapper consistently raisesStopIterationon subsequent reads.The change is limited to the synchronous chat wrapper and its tests, based directly on main. It preserves the original exception and yielded chunk objects. Async streams, Responses API wrappers and underlying HTTP stream closure are outside this change.
🧪 Testing
httpx.MockTransportresponses. They cover successful/error iteration with and without a manager, catching an error inside a manager, exception/chunk identity, caller exceptions, and repeated reads after termination. On unchanged main: 6 failures, 1 pass; with this fix: 7 pass.tests/unitwith coverage, Python 3.12.13 / Windows and complete test/dev groups fromuv.lock: 495 passed, 1 existing skip, with no test exclusions. OpenAI 1.71.0, OpenTelemetry SDK 1.31.1 and pytest 8.3.5.pdband disables optionalreadline, bypassing a legacy pdbpp/pyreadline startup incompatibility. No production code or installed dependency files are changed by the launcher. The suite still emits closed-log-stream messages during process shutdown.git diff --checkpass.Real provider requests, Linux CI and the remaining Python-version matrix have not been run locally.