litellm/tests/llm_responses_api_testing
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
..
base_responses_api.py fixing test_basic_openai_responses_api 2026-02-16 20:14:06 -08:00
conftest.py [Perf] Improvements for Async Success Handler (Logging Callbacks) - Approx +130 RPS (#13905) 2025-08-23 13:13:23 -07:00
test_anthropic_responses_api.py Fix anthropic responses 2026-02-20 17:30:42 -08:00
test_anthropic_tool_result_empty_call_id.py fix(responses): eliminate per-chunk thread spawning in async streaming path (#21709) 2026-02-20 16:26:23 -08:00
test_anthropic_tool_result_fix.py fix(responses): eliminate per-chunk thread spawning in async streaming path (#21709) 2026-02-20 16:26:23 -08:00
test_azure_responses_api.py test: test 2026-03-28 19:17:38 -07:00
test_base_responses_api_streaming_iterator.py fix: address greptile feedback 2026-03-18 21:36:39 -07:00
test_github_copilot_billing.py fix: resolve Greptile P0 issues for GitHub Copilot premium billing 2026-04-21 16:30:12 +01:00
test_google_ai_studio_responses_api.py Litellm sameer nov 3 stable branch (#16963) 2025-11-22 09:35:05 -08:00
test_openai_responses_api.py [Feat] Adds Shell tool support for the OpenAI Responses API (#21063) 2026-02-12 13:04:29 -08:00
test_responses_hooks.py Align responses API streaming hooks with chat pipeline 2026-01-06 10:54:19 +08:00