This fix addresses Bug 1 where failed LiteLLM logs were using request_id instead of session_id for Langfuse trace mapping, breaking trace correlation.
Changes:
1. Fix kwargs inconsistency in failure path (litellm_logging.py:2956)
- Changed from passing self.model_call_details to passing local kwargs variable
- Matches success path behavior and excludes original_response (potentially a coroutine)
2. Prioritize session_id as trace_id fallback (langfuse.py:607-615)
- When no explicit trace_id is provided, now uses session_id from metadata
- This ensures traces with the same session_id are grouped together in Langfuse
- Maintains backward compatibility: only activates when session_id is set
Testing:
- All 28 existing Langfuse tests pass (excluding pre-existing test_langfuse_e2e_sync which fails due to missing API key)
- Specifically verified trace_id resolution tests still pass
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
* fix(ui/): add mcp input as an example for custom code guardrails
* feat(a2a/): ensure a2a guardrails works on response output
* feat(a2a/): support streaming guardrails
* fix(ui/): add mcp input as an example for custom code guardrails
The __init__ method was trying to access self.__annotations__ before
super().__init__() was called, resulting in an empty annotations dict.
Changed to use the class annotations directly: LiteLLM_JWTAuth.__annotations__
instead of self.__annotations__.
This fixes the ValueError:
"Invalid arguments provided: user_email_jwt_field, user_id_upsert,
user_allowed_email_domain. Allowed arguments are: ."
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Fixes issue where users with disallowed email domains receive a
generic "user doesn't exist" error instead of a clear message
about the email domain not being allowed.
Changes:
- Add explicit check for valid_user_email before get_user_object
- Raise ProxyException with clear error message when email domain
is not in the allowed list
- Prevents confusing error message for email domain restrictions
This fixes the test_allow_access_by_email test failure.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>