test: reorder test_utils tail to keep the daily merge conflict-free - #33788
Conversation
The daily OSS branch and litellm_internal_staging each appended an independent test block at the very end of tests/test_litellm/test_utils.py, so merging the two collides on that shared end-of-file position even though the additions are unrelated (this branch adds the vertex embedding encoding-format tests; staging adds the per-model prompt-cache-minimum tests). Moving this branch's new TestVertexEmbeddingEncodingFormat class above test_gemini_image_models_do_not_support_reasoning, which both branches share, gives the two additions different anchors, so git applies both without a conflict and without pulling staging into this branch. Pure reorder; no test bodies change
Greptile SummaryThis PR reorders two blocks in
Confidence Score: 5/5Safe to merge — this is a pure test-block reorder with no logic changes. Every assertion, parametrize decorator, and fixture reference in No files require special attention.
|
| Filename | Overview |
|---|---|
| tests/test_litellm/test_utils.py | Pure reorder: moves TestVertexEmbeddingEncodingFormat above test_gemini_image_models_do_not_support_reasoning to give staging's additions a clean anchor point; no test logic is changed. |
Reviews (1): Last reviewed commit: "test: reorder test_utils tail to keep th..." | Re-trigger Greptile
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
0fe5483
into
litellm_oss_daily_2026_07_16
* fix(embeddings): accept encoding_format='float' for vertex_ai/gemini embeddings (#33617) OpenAI SDKs (and litellm's own client since ~1.84) send encoding_format='float' by default, but the vertex embedding config only supports ['dimensions'], so get_optional_params_embeddings raised UnsupportedParamsError at the provider default value. Any OpenAI-compatible client talking to a litellm proxy with vertex embedding models got a 400 unless the operator set proxy-wide drop_params: true. Float lists are exactly what the vertex API returns, so the param is a no-op: pop it before validation. Other values (e.g. 'base64') keep the existing unsupported-param behavior (dropped with drop_params, raise otherwise). Fixes #33173 Co-authored-by: Mihidum Hettiyahandi <55163074+mihidumh@users.noreply.github.com> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * feat(guardrails): add Singulr guardrail integration for LiteLLM gateway (#31302) * singulr guardrail support for litellm gateway * Update litellm/proxy/guardrails/guardrail_hooks/singulr/singulr.py Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * fix comments * improvement * fix: resolve review comments and implement requested improvements * fix:Guardrail bypass through uninspected messages * fix:tool text scanning * fix: Legacy function definitions bypass scanning by adding indirect message scaning * chore: remove unintended basedpyright budget file * fix:Response schema bypasses guardrail scanning (response_format.json_schema) * chore: restore basedpyright-code-budget.json and update lint baselines Restores the file deleted in c698b88 to match upstream litellm_internal_staging. Regenerates basedpyright and ruff-strict budget baselines via make lint-budget-update. * fix: scan system messages as indirect prompt injection in Singulr guardrail * chore: restore lint budget files to upstream baseline * fix: resolve ruff UP006 and I001 violations in singulr guardrail * Update litellm/proxy/guardrails/guardrail_hooks/singulr/singulr.py Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * resolve review comments on Singulr guardrail * fix: scan tool call results as indirect prompt injection in Singulr guardrail * Apply suggestion from @greptile-apps[bot] Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * minor * formating fix * refactor: shift extraction logic to singulr side * refactor:keep precall hook only * fix:formatting * fix:linting * improve config description * Trigger CI * fix * fix:field description * fix:errors due to change in field names * style: apply ruff line-wrap formatting to singulr guardrail * fix:exception * fix:formatting * fix playground * improved * Update litellm/proxy/guardrails/guardrail_hooks/singulr/singulr.py Co-authored-by: veria-ai[bot] <224490171+veria-ai[bot]@users.noreply.github.com> * Update litellm/proxy/guardrails/guardrail_hooks/singulr/singulr.py Co-authored-by: veria-ai[bot] <224490171+veria-ai[bot]@users.noreply.github.com> * fix * fix ci issues * remove uv.lock from pr * fix * fix:resolved comments * chore: trigger CI * remove uv.lock * fix * fix linting * fix linting * fix linting * remove doc strings * remove test fixes * chore: retrigger CI * change in singulr api contract * remove some ut * send litellm call_id to singulr --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Co-authored-by: aniket-kardile <aniket.kardile@singulr.ai> Co-authored-by: veria-ai[bot] <224490171+veria-ai[bot]@users.noreply.github.com> * Fix non-conformant UUIDv7 generation in native Opik integration (#31294) create_uuid7() encoded the timestamp in units of 16 seconds instead of milliseconds, so the top 48 bits came out ~4096x the real unix-ms. Opik's backend validates the embedded UUIDv7 timestamp on ingestion (OPIK-7067); the bad encoding decoded to ~year 2201 and every trace/span batch was rejected with HTTP 400. Rewrite create_uuid7() to be RFC 9562 conformant (top 48 bits = unix-ms), using the standard library only so no new dependency is added. Add unit tests covering UUIDv7 validity and millisecond timestamp encoding. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * feat(proxy): expose uvicorn concurrency limit (#33077) Expose uvicorn's limit_concurrency as a --limit_concurrency CLI flag and LIMIT_CONCURRENCY environment variable. Uvicorn counts both active tasks and accepted connections and returns HTTP 503 once the configured limit is reached. Reject non-positive limits at CLI parse time and only add the setting to the uvicorn startup arguments. Because idle connections also consume capacity, deployments should use upstream connection/header timeouts and per-client connection limits. * test: reorder test_utils tail to keep the daily merge conflict-free (#33788) The daily OSS branch and litellm_internal_staging each appended an independent test block at the very end of tests/test_litellm/test_utils.py, so merging the two collides on that shared end-of-file position even though the additions are unrelated (this branch adds the vertex embedding encoding-format tests; staging adds the per-model prompt-cache-minimum tests). Moving this branch's new TestVertexEmbeddingEncodingFormat class above test_gemini_image_models_do_not_support_reasoning, which both branches share, gives the two additions different anchors, so git applies both without a conflict and without pulling staging into this branch. Pure reorder; no test bodies change --------- Co-authored-by: Mateo Wang <277851410+mateo-berri@users.noreply.github.com> Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: Mihidum Hettiyahandi <55163074+mihidumh@users.noreply.github.com> Co-authored-by: madan-singulr <150280287+madan-singulr@users.noreply.github.com> Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Co-authored-by: aniket-kardile <aniket.kardile@singulr.ai> Co-authored-by: veria-ai[bot] <224490171+veria-ai[bot]@users.noreply.github.com> Co-authored-by: Aliaksandr Kuzmik <98702584+alexkuzmik@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: Salva Madrid <50212436+salvamadrid@users.noreply.github.com>
Relevant issues
Unblocks #33784 (the daily OSS branch merge into
litellm_internal_staging), which is currently CONFLICTING on this single fileLinear ticket
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
@greptileaito re-request a review after pushing changes)Screenshots / Proof of Fix
This change has no runtime or proxy surface; it only reorders two blocks in a unit-test file so the daily merge stays clean, so the meaningful proof is that the branch merge #33784 performs goes from conflicting to clean with both branches' tests preserved
Before, merging the current daily OSS tip into
litellm_internal_staging:After, merging this branch into
litellm_internal_staging:The merged file keeps everything from both sides: staging's per-model prompt-cache tests and their top-of-file imports (
get_prompt_cache_min_tokens,is_prompt_caching_valid_prompt), and this branch'sTestVertexEmbeddingEncodingFormat. No test body changes on either sideType
✅ Test
Changes
On the daily OSS branch,
tests/test_litellm/test_utils.pyappendedTestVertexEmbeddingEncodingFormat(from #33617) at the very end of the file. Onlitellm_internal_staging, the per-model prompt-cache tests were independently appended at the same end-of-file position. Git cannot order two unrelated insertions that share one anchor, so the branch merge collides there even though nothing actually overlapsThis moves
TestVertexEmbeddingEncodingFormatto sit just abovetest_gemini_image_models_do_not_support_reasoning, a test both branches already share unchanged. That leaves the gemini test as the file's tail, so staging's additions and this branch's additions land at different anchors and git merges both cleanly. It is a pure reorder with no test-logic change, and it deliberately pulls nolitellm_internal_stagingcontent into the OSS branch, so the public daily branch is not synced with internal stagingFinal Attestation