Repository navigation
test(responses): expect the 404 OpenAI now returns for an unknown model - #39457
Conversation
Greptile SummaryThis PR updates the Responses API end-to-end test to match OpenAI’s current 404 response for an unknown model.
Confidence Score: 5/5The PR appears safe to merge because the isolated test update matches the demonstrated upstream response and introduces no production behavior change. The changed assertion now expects the 404 exception observed through the configured OpenAI wildcard route, while the suite continues to verify 400 handling for malformed parameters separately.
|
| Filename | Overview |
|---|---|
| tests/openai_endpoints_tests/test_e2e_openai_responses_api.py | The test-only exception update matches the demonstrated live wildcard-route behavior without weakening the separate bad-parameter coverage. |
Reviews (1): Last reviewed commit: "test(responses): expect the 404 OpenAI n..." | Re-trigger Greptile
|
bugbot run |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit d33fe95. Configure here.
3b93746
into
litellm_internal_staging
TLDR
Problem this solves:
e2e_openai_endpointsis red on every CircleCI pipeline since 2026-09-02test_bad_request_errorstill expects a 400BadRequestErrorfor that callHow it solves it:
test_model_not_found_errorand expectopenai.NotFoundErrorUser Flow
Before: an engineer with a PR open watches
e2e_openai_endpointsgo red on a test whose request the proxy actually answers correctlyPOST https://litellm-domain/v1/responseswith{"model": "non-existent-model", "input": "This should fail"}to a proxy whoseopenai/*wildcard route forwards unknown models to OpenAIcode: model_not_foundand the text "The modelnon-existent-modeldoes not exist or you do not have access to it", the same status and text OpenAI itself returns for that model since 2026-09-02e2e_openai_endpointsrunstest_bad_request_error, which still expects a 400BadRequestErrorfor that call, sees the 404NotFoundErrorand fails, so the job is red on their PR and on every other PRAfter: the same request gets the same 404 and the job is green again
POST https://litellm-domain/v1/responseswith{"model": "non-existent-model", "input": "This should fail"}to the same proxycode: model_not_founde2e_openai_endpointsrunstest_model_not_found_error, which expects that 404NotFoundError, and the job passes on their PRRelevant issues
Linear ticket
Resolves LIT-6776
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
uv run pytest tests/test_litellm/<your_test_file>.py -v. Leave the suites (make test-unit-*,make test-unit) to CI: it finishes in ~15 minutes where a laptop takes an hour or more@greptileaito re-request a review after pushing changes)Delays in PR merge?
If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).
Screenshots / Proof of Fix
Setup shared by both legs: the CI job's own config (
litellm/proxy/example_config_yaml/oai_misc_config.yaml,"*"->openai/*, master keysk-1234,num_retries: 5), a fresh Postgres DB, and the proxy booted with 2 uvicorn workers on a random port. Port 4000 was taken by another proxy on the box and the test file hardcodeshttp://0.0.0.0:4000, so each leg runs a copy of the test file with only that host:port swapped for127.0.0.1:20023; the CircleCI runs linked below are the job's own unmodified commandBefore (ff1f21a)
test_bad_request_errorwith that same 404. The last green run, job 2143493 on 2026-09-01, shows in its proxy log that OpenAI answered the same request with400 Bad Requestback thenAfter (d33fe95)
e2e_openai_endpointsat this tip: green, job 2148657, the job's own unmodified commandType
✅ Test
Caveats (if any)
Low
Final Attestation