Repository navigation
fix(python-bridge): harden sync and async execution boundaries - #39332
Merged
yujonglee-berri merged 1 commit intoSep 2, 2026
Merged
yujonglee-berri merged 1 commit into
yujonglee-berri merged 1 commit into
Conversation
This was referenced Sep 2, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
yujonglee-berri
force-pushed
the
litellm_python_bridge_runtime_boundaries
branch
from
September 2, 2026 15:01
3a23a95 to
2b0f7e6
Compare
yujonglee-berri
marked this pull request as ready for review
September 2, 2026 15:26
yujonglee-berri
force-pushed
the
litellm_python_bridge_runtime_boundaries
branch
from
September 2, 2026 15:26
2b0f7e6 to
a5b9fba
Compare
Contributor
Greptile SummaryThe PR centralizes Python bridge route execution behind shared sync and async runtime helpers, adding GIL release, signal handling, nested-runtime rejection, panic conversion, and Python result conversion
Confidence Score: 5/5The PR appears safe to merge, with no concrete blocking or independently actionable non-blocking issue identified The shared runtime preserves route conversion and error contracts while adding bounded signal handling, panic containment, nested-runtime protection, and packaged-wheel regression coverage
|
| Filename | Overview |
|---|---|
| litellm-rust/crates/python-bridge/src/routes/runtime.rs | Adds a well-covered shared boundary for synchronous and asynchronous route execution, panic mapping, signal polling, and result conversion |
| litellm-rust/crates/python-interop/src/marshal.rs | Adds reusable panic-safe Pythonization while preserving the existing pythonize-based response shape and conversion errors |
| litellm-rust/crates/python-bridge/src/lib.rs | Updates module initialization for free-threaded Python support and preserves WebSocket header conversion and public registration |
| tests/test_litellm/rust_bridge/native_route_wheel_test.py | Adds bounded loopback-only packaged-wheel tests covering route behavior, concurrency, SIGINT propagation, and upstream cancellation |
| .github/workflows/test-rust.yml | Runs the new native route test against the single release wheel produced by the existing workflow |
Reviews (1): Last reviewed commit: 2b0f7e6 | Re-trigger Greptile
ishaan-berri
requested changes
Sep 2, 2026
yujonglee-berri
force-pushed
the
litellm_python_bridge_runtime_boundaries
branch
from
September 2, 2026 19:16
a5b9fba to
d69da84
Compare
yujonglee-berri
force-pushed
the
litellm_python_bridge_runtime_boundaries
branch
from
September 2, 2026 22:03
d69da84 to
80b7371
Compare
yujonglee-berri
force-pushed
the
litellm_python_bridge_runtime_boundaries
branch
from
September 2, 2026 22:05
80b7371 to
469f6c1
Compare
yujonglee-berri
force-pushed
the
litellm_python_bridge_runtime_boundaries
branch
from
September 2, 2026 22:21
469f6c1 to
b10282f
Compare
ishaan-berri
approved these changes
Sep 2, 2026
tin-berri
approved these changes
Sep 2, 2026
yujonglee-berri
merged commit Sep 2, 2026
62e318d
into
litellm_internal_staging
95 of 132 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Layer 6 of 17 in the reorganized Rust bridge stack
Scope
Adds Pythonized conversion, panic mapping, and shared sync/async execution helpers for GIL release, nested-runtime rejection, signal polling, cancellation, and safe result conversion
The helpers live in
crates/python-bridge/src/execution.rs, outsideroutes/, with inline tests. Routes retain request assembly and tracing. Packaged bridge tests cover sync and async success, traced responses, upstream errors, concurrency, and SIGINT cancellationReview boundary
Rebased onto the current
litellm_python_bridge_modulesbase, preserving its shared request assembly and tracing support. Later behavior remains outside this PRSupersedes #39263, whose record GitHub automatically marked merged when its former stacked base temporarily became a descendant during the guarded branch rewrite. The original discussion remains there; this PR is the live review head
Validation
Formatting, focused strict Clippy for core/interop/bridge, and all 264 Rust workspace tests pass. The release wheel builds and passes the packaged route tests, including traced sync/async responses and SIGINT cancellation. Ruff passes for the packaged test script
Full gateway Clippy with the server feature reports three existing
collapsible_ifwarnings in unchanged realtime code