mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-17 04:34:25 +00:00
This commit addresses both P0 issues flagged in Greptile review to achieve 5/5 score (currently 4/5). **P0 Issue #1: Responses API X-Initiator never set** Root cause: The X-Initiator header was being set in validate_environment(), which doesn't have access to the `input` parameter. The _get_input_from_params() helper checked for `litellm_params.input`, but this attribute doesn't exist in GenericLiteLLMParams - the `input` parameter is passed separately to transform_responses_api_request(). Fix: Moved X-Initiator and vision header logic from validate_environment() to transform_responses_api_request() where the `input` parameter is available. This ensures the header is correctly set for Responses API requests. Changes: - Added transform_responses_api_request() override in GithubCopilotResponsesAPIConfig that: 1. Calculates X-Initiator based on input analysis 2. Adds copilot-vision-request header if images detected 3. Calls parent to validate input and handle reasoning items - Removed broken _get_input_from_params() helper - Simplified validate_environment() docstring and removed duplicate logic **P0 Issue #2: Integration test in wrong location** Root cause: tests/llm_translation/test_github_copilot_billing.py makes real network calls via litellm.completion(), violating the repository rule that tests/llm_translation/ is for mock-only tests. Fix: Moved test file to tests/llm_responses_api_testing/ which is the designated directory for integration tests that make real API calls. Impact: - Responses API requests now correctly set X-Initiator header - Multi-turn agentic workflows (Plan mode, tool calls, agent flows) will only consume 1 premium request per session instead of 1 per turn - Integration tests now in proper location per repository conventions Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| base_responses_api.py | ||
| conftest.py | ||
| test_anthropic_responses_api.py | ||
| test_anthropic_tool_result_empty_call_id.py | ||
| test_anthropic_tool_result_fix.py | ||
| test_azure_responses_api.py | ||
| test_base_responses_api_streaming_iterator.py | ||
| test_github_copilot_billing.py | ||
| test_google_ai_studio_responses_api.py | ||
| test_openai_responses_api.py | ||
| test_responses_hooks.py | ||