Skip to content

test: reorder test_utils tail to keep the daily merge conflict-free - #33788

Merged
yuneng-berri merged 1 commit into
litellm_oss_daily_2026_07_16from
litellm_/resolve-merge-conflicts-e10f1c
Jul 17, 2026
Merged

test: reorder test_utils tail to keep the daily merge conflict-free#33788
yuneng-berri merged 1 commit into
litellm_oss_daily_2026_07_16from
litellm_/resolve-merge-conflicts-e10f1c

Conversation

@yuneng-berri

Copy link
Copy Markdown
Collaborator

Relevant issues

Unblocks #33784 (the daily OSS branch merge into litellm_internal_staging), which is currently CONFLICTING on this single file

Linear ticket

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have added meaningful tests
  • My PR passes all CI/CD checks (e.g., lint, format, unit tests)
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • I have received a Greptile Confidence Score of at least 4/5 before requesting a maintainer review (Greptile reviews automatically once the PR is opened; only comment @greptileai to 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:

$ git merge --no-commit --no-ff origin/litellm_oss_daily_2026_07_16
CONFLICT (content): Merge conflict in tests/test_litellm/test_utils.py
Automatic merge failed; fix conflicts and then commit the result.
# conflicted files: tests/test_litellm/test_utils.py

After, merging this branch into litellm_internal_staging:

$ git merge --no-commit --no-ff origin/litellm_/resolve-merge-conflicts-e10f1c
Auto-merging tests/test_litellm/test_utils.py
Automatic merge went well; stopped before committing as requested
# conflicted files: (none)

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's TestVertexEmbeddingEncodingFormat. No test body changes on either side

Type

✅ Test

Changes

On the daily OSS branch, tests/test_litellm/test_utils.py appended TestVertexEmbeddingEncodingFormat (from #33617) at the very end of the file. On litellm_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 overlaps

This moves TestVertexEmbeddingEncodingFormat to sit just above test_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 no litellm_internal_staging content into the OSS branch, so the public daily branch is not synced with internal staging

Final Attestation

  • The tests check the right things, including the edge cases, and regressions in the respective real-world customer use-cases are not possible after this PR

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-apps

greptile-apps Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR reorders two blocks in tests/test_litellm/test_utils.py to resolve a merge conflict caused by independent end-of-file insertions on the OSS daily branch and litellm_internal_staging. No test assertions, fixtures, or imports are modified.

  • TestVertexEmbeddingEncodingFormat (added by fix(embeddings): accept encoding_format="float" for vertex_ai/gemini embeddings #33617) is moved to sit just above test_gemini_image_models_do_not_support_reasoning, so the gemini test remains the file's tail and staging's new tests can land at a different anchor without conflict.
  • The test_gemini_image_models_do_not_support_reasoning function is reproduced verbatim at the end of the file — every parametrized model, every assertion, every error message is identical to the original.

Confidence Score: 5/5

Safe to merge — this is a pure test-block reorder with no logic changes.

Every assertion, parametrize decorator, and fixture reference in test_gemini_image_models_do_not_support_reasoning is reproduced exactly at its new position. TestVertexEmbeddingEncodingFormat is untouched. No production code is affected.

No files require special attention.

Important Files Changed

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

codecov Bot commented Jul 17, 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
yuneng-berri enabled auto-merge (squash) July 17, 2026 23:11
@yuneng-berri
yuneng-berri merged commit 0fe5483 into litellm_oss_daily_2026_07_16 Jul 17, 2026
49 of 50 checks passed
@yuneng-berri
yuneng-berri deleted the litellm_/resolve-merge-conflicts-e10f1c branch July 17, 2026 23:12
yuneng-berri added a commit that referenced this pull request Jul 17, 2026
* 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>
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