Skip to content

test(ci): refresh qualified retired OpenAI fixtures - #43938

Merged
yuneng-berri merged 2 commits into
mainfrom
litellm_refresh_retired_circle_fixtures
Sep 30, 2026
Merged

yuneng-berri merged 2 commits into
mainfrom
litellm_refresh_retired_circle_fixtures

Conversation

@yuneng-berri

@yuneng-berri yuneng-berri commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

TLDR

Problem this solves:

  • Eight live checks still select retired OpenAI fixtures
  • Denied fallback checks previously accepted unrelated exceptions

How it solves it:

  • Use live gpt-6-luna with reasoning disabled
  • Preserve streaming, usage, engine selection, functions, and fallback checks
  • Require HTTP 403 for both denied fallback variants

User Flow

Before: a contributor's live conformance requests stop at retired models

  1. Send a streaming POST /v1/completions using the configured fixture
  2. Receive a retirement error instead of completion text and usage
  3. Send POST /v1/chat/completions with an authorized fallback
  4. The fallback also fails because its configured model is retired

After: the contributor can verify these behaviors against a supported model

  1. Send a streaming POST /v1/completions using the refreshed fixture
  2. Receive completion text and positive final token usage
  3. Send POST /v1/chat/completions with an authorized fallback
  4. Receive the fallback's reply; keys without access still receive 403

Scope and coverage

This repairs eight original failing cases, with ten focused executions including both denied-access variants

Existing cases Preserved check
test_completion_openai_engine_and_model, test_completion_openai_engine Explicit model beats engine; engine-only selection works; text is nonempty
test_async_text_completion_stream Exactly one finish reason and nonempty text
test_openai_stream_options_call_text_completion Positive final usage; all earlier usage fields remain null
test_completion_streaming_usage_metrics Public /completions final prompt/completion/total usage
test_completion_openai_with_functions Live legacy functions request; actual streamed function name and JSON arguments
Both client fallback tests Authorized target succeeds; custom messages reach the target; unauthorized target returns 403

The text API cases exercise LiteLLM's existing chat-to-text bridge. They do not claim native OpenAI /v1/completions transport coverage. No provider responses are fabricated, tests skipped, callback internals reset, or protected assertions removed. The old gpt-instruct configuration remains for tests that specifically exercise native text providers

CircleCI pipeline 90628 recorded the original failures at bda2763f2c722d617171e71deb331d3de7d345e7. This PR excludes the four cases already fixed by #43676 and the separate changes in #43902

Validation

  • Merge-base test sources: 8 failed, 2 passed, all eight failures still selected retired fixtures
  • Current tip with real OpenAI and an isolated PostgreSQL-backed proxy: 10 passed
  • Temporary product mutations broke engine precedence, finish reasons, SDK/proxy usage, function assembly, fallback authorization, and custom fallback messages: every corresponding test failed
  • Bypassing both fallback authorization checks caused both denied variants to fail with DID NOT RAISE PermissionDeniedError
  • Dropping custom fallback messages made the revised live input-usage comparison fail as 10 != 33; its direct controls use identical request settings
  • Restoring product source returned 10 passed
  • make check: PASS, including test-tree lint and the test-quality budget

Current-head automatic CI is terminal: 90 passed, 5 failed, 1 skipped. The failures are outside this change: documentation and code-quality report the same three undocumented ClickHouse environment keys, proxy-endpoints reproduces two existing malformed Request mocks, and misc retains the four Google contract lookup failures. Proxy-behavior passed all 929 tests, then failed Codecov download signature verification

Greptile's current-head review is 5/5, with all findings resolved. Veria and patch coverage passed; no Bugbot result is available. Buildkite passed its gate-only job and did not execute these legacy live tests. No automatically created CircleCI pipeline was observed for this branch

Screenshots / Proof of Fix

Both fixture models were configured on an isolated proxy at http://127.0.0.1:59538, backed by its own PostgreSQL/Redis, with real OpenAI credentials. The existing CI setting allowing forced fallback requests was enabled. Product source was identical in both runs; only the selected fixture changed. Temporary generated keys were deleted after these HTTP probes

The streaming proof used this command with FIXTURE_MODEL=gpt-instruct before and FIXTURE_MODEL=gpt-6-luna after:

curl -sS -N -w '\nHTTP %{http_code}\n' \
  http://127.0.0.1:59538/v1/completions \
  -H 'Authorization: Bearer sk-1234' -H 'Content-Type: application/json' \
  -d "{\"model\":\"$FIXTURE_MODEL\",\"prompt\":\"hey\",\"stream\":true,\"stream_options\":{\"include_usage\":true},\"max_tokens\":4,\"temperature\":0.00000001}"

Before (52b9fa2)

Text stream usage

  1. POST /v1/completions with {"model":"gpt-instruct","prompt":"hey","stream":true,"stream_options":{"include_usage":true},"max_tokens":4,"temperature":0.00000001}
  2. Observe HTTP 404, explicitly naming deprecated gpt-3.5-turbo-instruct

Fallback authorization and messages

  1. Generate keys with models:["gpt-3.5-turbo"], and with the fallback gpt-instruct additionally allowed
  2. POST /v1/chat/completions using the primary model, mock_testing_fallbacks:true, and fallbacks:["gpt-instruct"]; repeat with a fallback object containing custom messages
  3. Observe HTTP 403 for both denied variants and HTTP 500 for both authorized variants, with the nested fallback retirement failure

After (1ba94a2)

Text stream usage

  1. Send the same request with fixture model:"gpt-6-luna"
  2. Observe HTTP 200, nonempty text, four SSE chunks, and final usage {prompt_tokens:7,completion_tokens:4,total_tokens:11}

Fallback authorization and messages

  1. Generate the same key variants with fallback gpt-6-luna
  2. Send the same requests with the longer custom weather prompt, then call the fallback model directly with each prompt as positive controls
  3. Observe HTTP 403 for both denied variants and HTTP 200 for both authorized variants; the custom fallback and custom direct control each report 33 prompt tokens, while the original-message control reports 10
  4. The test compares the two live controls rather than hardcoding token counts or provider response wording

Caveats

Medium

  • Ten other retired-fixture failures remain outside this repair
  • Three specifically exercise retired native OpenAI transport
  • Two exercise batching the live chat bridge cannot preserve
  • Four exercise native echo or integer logprobs
  • One depends on the separately deferred callback registration defect

OpenAI's retirement inventory covers all three models named by the native completion API. Bounded live probes confirmed the documented replacement gpt-5.6-terra rejects native completions, echo, and integer logprobs; the bridge also collapses string batches and rejects token-ID batches. Those tests are left visible instead of weakening their contracts

Pre-Submission checklist

  • Meaningful assertions and negative controls included
  • Focused live tests pass locally
  • All required CI/CD checks pass
  • Scope isolates one fixture-retirement problem
  • Greptile confidence 5/5 on current tip, all findings resolved

Type

Test

@yuneng-berri
yuneng-berri marked this pull request as ready for review September 30, 2026 22:37
@yuneng-berri
yuneng-berri requested a review from a team September 30, 2026 22:37
@greptile-apps

greptile-apps Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium risk] Test fixtures updated to use new model and configuration.

The PR appears safe to merge; no outstanding finding or new actionable issue was identified.

Summary

The PR replaces retired OpenAI fixtures in live completion, streaming, function-call, and fallback tests. The latest changes annotate the reviewed assignments with Final and replace an exact provider-reply assertion with live prompt-usage controls.

  • The streaming finding was withdrawn after verification.
  • The two remaining previous findings are addressed by the current code.

Reviews (2) · Last reviewed commit: "test(ci): compare fallback input usage i..."

Comment thread tests/local_testing/test_streaming.py Resolved
Comment thread tests/test_fallbacks.py Resolved
Comment thread tests/test_fallbacks.py Resolved
@codecov

codecov Bot commented Sep 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@yuneng-berri

Copy link
Copy Markdown
Contributor Author

@greptileai Please review 1ba94a2: Final annotations fixed, provider wording replaced with live usage controls, and streaming finding withdrawn after runtime verification

@yuneng-berri
yuneng-berri merged commit f8f0576 into main Sep 30, 2026
92 of 98 checks passed
@yuneng-berri
yuneng-berri deleted the litellm_refresh_retired_circle_fixtures branch September 30, 2026 23:10
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.

2 participants