Skip to content

feat(gateway-inference): record how a call failed the way python logs it - #54521

Draft
narmstrong-berri wants to merge 1 commit into
nate_slp_5_logged_responsefrom
nate_slp_6_failure
Draft

narmstrong-berri wants to merge 1 commit into
nate_slp_5_logged_responsefrom
nate_slp_6_failure

Conversation

@narmstrong-berri

@narmstrong-berri narmstrong-berri commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #54520. Records each gateway failure as the exception Python would have logged, so the failure payload's error_information and error_str can be built from the call record

How

  • record/failure.rs CallFailure { Raised, ClientDisconnected } (one CallState field), written in serve.rs next to respond_with_error
  • standard-logging/src/failure.rs: Python exception class table with isinstance chain and message prefixes, rate-limit category/type, normalize_error, is_expected_client_error, provider request id
  • core-utils: Anthropic branch of Python's exception mapping (text rules, 529 to InternalServerError)

Test results

  • clippy and cargo check --all-targets pass for standard-logging, core-utils, gateway-inference; unit tests run in CI

Caveats

  • Tracebacks for unexpected errors are the Rust cause chain; expected client errors log none, like Python
  • ClientDisconnected exists but is not written yet; the "LiteLLM Retried: N times" suffix is not reproduced
  • Providers without a ported mapper use the generic status table

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant