litellm/litellm
jtstothard fedfaefd81
fix: resolve Greptile P0 issues for GitHub Copilot premium billing
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>
2026-04-21 16:30:12 +01:00
..
a2a_protocol fix(a2a): default create_a2a_client timeout to DEFAULT_A2A_AGENT_TIMEOUT 2026-04-10 21:06:44 +03:00
anthropic_interface style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
assistants
batch_completion fix: prompt registry 2026-02-18 00:34:54 +05:30
batches Merge pull request #23957 from Sameerlite/litellm_vertex-cancel-batch 2026-03-20 23:32:50 +05:30
caching fix(cache): Prevent "multiple values" error in get_cache_key (#20261) 2026-04-04 18:40:56 -07:00
completion_extras fix(lint): apply Black formatting to 14 files (#24532) 2026-03-31 07:45:55 -07:00
containers feat(containers): Azure routing, managed container IDs, delete response parsing (#25287) 2026-04-11 09:21:01 -07:00
endpoints/speech/speech_to_completion_bridge
evals Root cause fix - migrate all logging update to use 1 function - for centralized kwarg updates (#23659) 2026-03-15 23:21:01 -07:00
experimental_mcp_client Litellm ishaan march30 (#24887) (#25151) 2026-04-04 14:44:07 -07:00
files Update streaming.py. Provide Type Annotation for empty dict 2026-04-11 13:04:25 -07:00
fine_tuning address greptile review feedback (greploop iteration 1) 2026-03-27 20:04:41 +05:30
google_genai Root cause fix - migrate all logging update to use 1 function - for centralized kwarg updates (#23659) 2026-03-15 23:21:01 -07:00
images Root cause fix - migrate all logging update to use 1 function - for centralized kwarg updates (#23659) 2026-03-15 23:21:01 -07:00
integrations Fix tests 2026-04-14 21:18:23 +05:30
interactions Root cause fix - migrate all logging update to use 1 function - for centralized kwarg updates (#23659) 2026-03-15 23:21:01 -07:00
litellm_core_utils Merge pull request #25396 from BerriAI/litellm_bedrock-normalize-custom-tool-schema 2026-04-14 10:21:15 -07:00
llms fix: resolve Greptile P0 issues for GitHub Copilot premium billing 2026-04-21 16:30:12 +01:00
ocr Root cause fix - migrate all logging update to use 1 function - for centralized kwarg updates (#23659) 2026-03-15 23:21:01 -07:00
passthrough style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
proxy Merge pull request #25589 from BerriAI/litellm_oss_staging_04_11_2026 2026-04-14 23:34:25 +05:30
proxy_auth fix: prompt registry 2026-02-18 00:34:54 +05:30
rag style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
realtime_api Root cause fix - migrate all logging update to use 1 function - for centralized kwarg updates (#23659) 2026-03-15 23:21:01 -07:00
rerank_api Root cause fix - migrate all logging update to use 1 function - for centralized kwarg updates (#23659) 2026-03-15 23:21:01 -07:00
responses feat(containers): Azure routing, managed container IDs, delete response parsing (#25287) 2026-04-11 09:21:01 -07:00
router_strategy Litellm ishaan march30 (#24887) (#25151) 2026-04-04 14:44:07 -07:00
router_utils fix(router): don't create litellm_metadata for non-Responses API calls in encrypted_content_affinity_check (#25347) 2026-04-08 21:11:19 -07:00
search Root cause fix - migrate all logging update to use 1 function - for centralized kwarg updates (#23659) 2026-03-15 23:21:01 -07:00
secret_managers address review feedback 2026-04-11 21:52:39 -07:00
skills Root cause fix - migrate all logging update to use 1 function - for centralized kwarg updates (#23659) 2026-03-15 23:21:01 -07:00
types Merge pull request #25348 from BerriAI/litellm_gemini-veo-video-resolution-pricing2 2026-04-14 10:23:22 -07:00
vector_store_files Root cause fix - migrate all logging update to use 1 function - for centralized kwarg updates (#23659) 2026-03-15 23:21:01 -07:00
vector_stores Root cause fix - migrate all logging update to use 1 function - for centralized kwarg updates (#23659) 2026-03-15 23:21:01 -07:00
videos [Staging] - Ishaan March 17th (#23903) 2026-03-18 15:09:01 -07:00
__init__.py Reduce default latency histogram bucket cardinality (#25527) 2026-04-11 09:34:45 -07:00
_lazy_imports.py style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
_lazy_imports_registry.py feat: add sagemaker_nova provider for Amazon Nova models on SageMaker (#21542) 2026-03-14 15:10:01 -07:00
_logging.py Litellm oss staging 04 02 2026 p1 (#25055) 2026-04-08 21:37:10 -07:00
_redis.py Litellm ishaan march23 - MCP Toolsets + GCP Caching fix (#25146) (#25155) 2026-04-04 16:23:21 -07:00
_redis_credential_provider.py Litellm ishaan march23 - MCP Toolsets + GCP Caching fix (#25146) (#25155) 2026-04-04 16:23:21 -07:00
_service_logger.py style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
_uuid.py
_version.py
anthropic_beta_headers_config.json feat(anthropic): register advisor-tool-2026-03-01 in beta headers config 2026-04-10 12:39:30 -07:00
anthropic_beta_headers_manager.py Refactor: Filtering beta header after transformation 2026-03-16 10:47:15 +05:30
blog_posts.json docs(blog): add WebRTC blog post link 2026-03-13 17:54:33 +05:30
budget_manager.py
constants.py Merge branch 'main' into litellm_oss_staging_04_11_2026 2026-04-14 20:54:12 +05:30
cost.json
cost_calculator.py Fix greptile review 2026-04-08 22:08:52 +05:30
exceptions.py style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
main.py Revert "fix(embedding): omit null encoding_format for openai requests (#25395)" 2026-04-14 20:36:28 +05:30
model_prices_and_context_window_backup.json Merge pull request #25589 from BerriAI/litellm_oss_staging_04_11_2026 2026-04-14 23:34:25 +05:30
mypy.ini
policy_templates_backup.json feat(add-new-block_code_execution-guardrail): prevent agent from executing code (#22154) 2026-02-25 22:02:14 -08:00
provider_endpoints_support_backup.json feat(search): add Serper (serper.dev) as search provider (#23112) 2026-03-09 08:40:37 -07:00
py.typed
router.py fix(router): pass custom_llm_provider to get_llm_provider for unprefixed model names (#25334) 2026-04-08 21:27:13 -07:00
scheduler.py style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
setup_wizard.py Litellm fix update bedrock models (#24947) 2026-04-01 19:22:54 -07:00
timeout.py
utils.py Merge pull request #25348 from BerriAI/litellm_gemini-veo-video-resolution-pricing2 2026-04-14 10:23:22 -07:00