Proof Portal

Project overview

litellm

BerriAI117 findings · 107 requirements

LiteLLM Python->Rust migration audit (proof mirroring).

Back to findings
Known issueKI-responses-streaming-typed-dispatch-divergence

Python->Rust: typed streaming-event dispatch + null error.code coalesce absent (Rust WS passthrough is untyped)

OpenOpenLow

Low-severity issue, currently open.

How well is this finding proven?

  1. 1.Reported / candidate

    Complete

  2. 2.Reproducer written

    Complete

    View reproducer
  3. 3.Reproduces (recorded run)

    Not yet established

  4. 4.Independently re-run

    Not yet established

  5. 5.Meets quality standard

    Not assessed

  6. 6.Validated for submission

    Not assessed

Recorded runs show whether the issue reproduces. Independent re-runs are shown separately. A later review does not fill in a missing earlier step.

Description

The issue as recorded.

MIR-003 divergence (STK-REQ-RSP0 + SYS-REQ-RSP1 streaming obligations). Python transform_streaming_response maps each parsed SSE chunk to its typed event model via get_event_model_class (30+ event types, GenericEvent fallback for unknown/shell events), coalesces a null error.code to 'unknown_error' so validation succeeds, and falls back to model_construct when strict pydantic validation fails on a provider that omits required fields (issue 20570). The nearest Rust surface, OPENAI_RESPONSES_WS_CONFIG.transform_ws_response, is an untyped passthrough that returns the event clone unchanged: no per-type typed dispatch, no null error.code coalescing, no model_construct-style lenient fallback. Different transport (WS frames vs HTTP SSE) but the same streaming-normalization contract is unmet on the Rust side. Portable-but-not-yet-ported; MIR-003 cells stay honest debt. No behavior changed.

Reachability

Evidence disposition (issue #392): this finding documents an ABSENCE in the Rust target (litellm-rust/crates/, outside the Python verification_scope in proof.yaml), established by the static grep/read recorded in reproducer_command. There is no runnable Python-scope tripwire that can reproduce a Rust-side absence, so proof evidence refresh cannot stamp a current evidence row. Reviewed and accepted as honest tracked debt below the runnable-reproducer floor; fabricating an evidence hash would be dishonest.

Affected requirements

The requirement(s) this issue violates — click through to the spec.

Port parity

How this finding relates to the port: whether the behaviour diverges, isn't ported yet, was fixed, or matches across both implementations.

  • OpenAI Responses API: Python -> RustMIR-003
    Not yet ported to RustPython → Rust
    View in Mirrors

Severity, explained

Why this is rated the way it is — and the scoring signals behind the rating (each ⓘ explains the term).

LowRated severity — the impact if this issue is exploited or hit.
why this rating
Risk-rated
risk area
Correctness
Security classification
Not a security surface
CVE surface
None

Where it is

The code the issue lives in — peek the affected function inline to see it in context.

  • OpenAIResponsesAPIConfig.transform_streaming_response/get_event_model_class (Python) vs OpenAIResponsesWsConfig.transform_ws_response (Rust)

Reproduction steps

Technical steps for your engineers to confirm the issue by hand.

read litellm-rust/crates/core/src/providers/openai/responses/transformation.rs:24-30 (transform_ws_response is passthrough) vs litellm/llms/openai/responses/transformation.py:330-420

What protects you, and the fix

What limits your exposure today, and the planned remediation.

What protects you now

Python path performs typed dispatch; Rust WS passthrough preserves payload but does not type/normalize events.

The fix

Port typed event dispatch + null-code coalesce + lenient fallback if/when Rust owns Responses streaming. Audit finding only.

Blast radius

If you touch this issue, what else may need re-checking — the requirements it affects and the code and tests that hang off them. Historical view: authored trace links only — automatically derived links aren't reconstructible for past runs.

No authoredcode links reach these requirements in this historical reconstruction. Automatically derived code links aren't reconstructible for past runs, so implementing code may have existed without an authored trace.

Tracing blast radius…

Per-requirement evidence

For each requirement this finding touches: the implementing code, verifying tests, and proof obligations that discharge it.

Tests & evidence (2)
  • docs/requirements/openai_responses.md
  • tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py
Proof obligations (3)
error_handling

Behavior when operations fail or dependencies are unavailable.

  • ✓negative (required) — tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py:1675, tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py:1674
malformed_input

Behavior when inputs are syntactically or structurally invalid.

  • ✓negative (required) — tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py:1763, tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py:1762
  • ✓nominal — tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py:1761
nominal

Happy-path behavior with valid inputs.

  • ✓nominal — tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py:1575, tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py:1696, tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py:1726, tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py:1937, tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py:1995, tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py:1574, tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py:1598, tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py:1631, tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py:1695, tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py:1725, tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py:1833, tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py:1871, tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py:1895, tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py:1936, tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py:1994
Tests & evidence (2)
  • docs/requirements/openai_responses.md
  • tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py
Proof obligations (3)
error_handling

Behavior when operations fail or dependencies are unavailable.

  • ✓negative (required) — tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py:1802, tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py:1673, tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py:1674
  • ✓nominal (required) — tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py:1789, tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py:1630
malformed_input

Behavior when inputs are syntactically or structurally invalid.

  • ✓negative (required) — tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py:1832, tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py:1760, tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py:1935, tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py:1762
  • ✓nominal (required) — tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py:1831, tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py:1759, tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py:1788, tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py:1934, tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py:1761
nominal

Happy-path behavior with valid inputs.

  • ✓nominal (required) — tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py:1830, tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py:1855, tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py:1869, tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py:1571, tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py:1893, tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py:1758, tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py:1783, tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py:1933, tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py:1613, tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py:1629, tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py:1643, tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py:1660, tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py:1595, tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py:1692, tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py:1724, tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py:1574, tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py:1598, tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py:1631, tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py:1695, tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py:1725, tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py:1833, tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py:1871, tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py:1895, tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py:1936, tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py:1994

Change history

Every recorded revision of this finding's source file — when it was added, edited, or re-classified, with the diff for each change.

Discussions

Discuss this with the proof team. Nothing changes in your audit automatically — you open a request and a staff member records any outcome inside the thread.

Sign in to discuss this with the proof team.Sign in