Repository navigation
test(decisions): add hosted_vllm /v1/decisions and provider-400 translation cases - #45661
Conversation
…lation cases Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
|
kerry seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
TLDR
Problem this solves:
hosted_vllmto Decisions but its onlyTranslationTestCasecovers/v1/systemone/v1/decisions, the route with the actual translation logic, had no exact-literal caseHow it solves it:
TranslationTestCasegetsmock_provider_status_code(default 200),assert_translationpasses it toReplyQWEN3_0_6B_DECISIONS_TEST_CASE: OpenAIchoicebody in, exact vLLM/v1/systemonebody out, OpenAI answer backQWEN3_0_6B_PREDICATE_REJECTED_TEST_CASE: OpenAIpredicategoes out asnoul, vLLM's 400 comes back as LiteLLM's 400702ce313f, Qwen/Qwen3-0.6B) with the exact bodies the cases pinLinear ticket
Related to LIT-9367
Pre-Submission checklist
uv run pytest tests/unit/<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)Screenshots / Proof of Fix
Test-only PR, so the proof is the cases going red under mutation and green on the shipped code. Local integration rig (
tests/integration/proxy_config.yaml, fake provider on :8191),tests/integration/translation/decisions/basic/test_decisions_basic_hosted_vllm.pyBefore (05166e2, runner mutated)
Mutation 1:
assert_translationignoresmock_provider_status_codeand replies 200python tests/integration/run.py providers tests/integration/translation/decisions/basic/test_decisions_basic_hosted_vllm.pyhosted_vllm/Qwen/Qwen3-0.6B-predicate_rejectedfails:assert 500 == 400, LiteLLM turns the 200 error body intoInternalServerError ... 1 validation error for DecisionsResponse. 1 failed, 2 passedMutation 2:
BaseDecisionsConfigsends choicecriteriaunder the keyoptionsbasicanddecisionsfail on the provider body:{'is_defect': {'type': 'choice', ..., 'options': {'yes': None, 'no': None}}} == {... 'criteria': ...}. 2 failed, 1 passedAfter (37d3bab)
3 passed, and a second run against the same Redis also3 passed(theno-cacheflag holds)tests/integration/providers/test_decisions_wire.pystill pass with the runner changeProvider captures, exact
expected_provider_requestbodies sent to the real vLLM on 2026-10-09:POST /v1/systemone-> 200{"id":"decision-91ce41627dbf016f","object":"structured_decision",...,"answers":{"is_defect":{"type":"choice","choice":"yes","probabilities":{"yes":0.8670357477770336,"no":0.13296425222296632},"confidence":0.8669148648509282}},"usage":{"input_tokens":43,"output_tokens":1},...}POST /v1/systemone-> 400{"error":{"message":"unknown question type 'noul'; supported: ['choice']","type":"BadRequestError","param":null,"code":400}}Type
✅ Test
Caveats (if any)
Low
model group 'hosted_vllm/Qwen/Qwen3-0.6B', so a change to proxy error wording fails it on purpose/v1/decisionscase yet; same pattern applies if wantedFinal Attestation
Link to Devin session: https://app.devin.ai/sessions/3d0a4b725c1d4d65968372a35704cdd2
Open in Devin Desktop: https://app.devin.ai/desktop/session/3d0a4b725c1d4d65968372a35704cdd2?variant=devin
Requested by: @kerry-berri
Note
Devin errored when opening this Pull Request as kerry-berri.
As a fallback, Devin opened this PR as itself.