ci: Add openai to uv typing group - #7334
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 14104d1. Configure here.
Codecov Results 📊✅ 130462 passed | ⏭️ 7110 skipped | Total: 137572 | Pass Rate: 94.83% | Execution Time: 469m 23s 📊 Comparison with Base Branch
➖ Removed Tests (1)View removed tests
All tests are passing successfully. ✅ Patch coverage is 100.00%. Project has 2505 uncovered lines. Files with missing lines (1)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 90.24% 90.25% +0.01%
==========================================
Files 193 193 —
Lines 25685 25689 +4
Branches 9474 9474 —
==========================================
+ Hits 23178 23184 +6
- Misses 2507 2505 -2
- Partials 1438 1436 -2Generated by Codecov Action |
openai to uv typing group
| def _wrap_chat_completion_create( | ||
| f: "Callable[..., Union[ChatCompletion, Stream[ChatCompletionChunk]]]", | ||
| ) -> "Callable[..., Coroutine[Any, Any, Union[ChatCompletion, Stream[ChatCompletionChunk]]]]": |
There was a problem hiding this comment.
_wrap_chat_completion_create claims a Coroutine return type for a sync wrapper
The return annotation of _wrap_chat_completion_create should be a sync Callable returning Union[ChatCompletion, Stream[ChatCompletionChunk]], not Coroutine[...]; as written it types the sync Completions.create patch as async.
Evidence
_wrap_chat_completion_createreturns_sentry_patched_create_sync, a plaindefthat calls_new_sync_chat_completionand returns its result directly.- The annotated return type is
Callable[..., Coroutine[Any, Any, Union[ChatCompletion, Stream[ChatCompletionChunk]]]]. - The matching async helper
_wrap_async_chat_completion_createcorrectly usesCoroutine[...]; the sync helper should mirror_new_sync_chat_completion's non-coroutine return type instead.
Identified by Warden · find-bugs · QFC-W6J

Description
Add
openaito the typing dependency group and fix the resulting mypy errors.Resolves:
Issues
closes #7020
Reminders
uv run ruff.feat:,fix:,ref:,meta:)