Skip to content

test(integration): expect the Exa search envelope's provider_metadata after #47423 - #47572

Merged
mateo-berri merged 1 commit into
mainfrom
litellm_circleci_heal_search_envelope
Oct 20, 2026
Merged

mateo-berri merged 1 commit into
mainfrom
litellm_circleci_heal_search_envelope

Conversation

@mateo-berri

@mateo-berri mateo-berri commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

TLDR

Problem this solves:

  • Three search integration tests are red on every scheduled CircleCI run on main
  • They pin the old /v1/search envelope without provider_metadata

How it solves it:

User Flow

Before: CircleCI on main reports integration-management and integration-management-replica red for search tests

  1. A scheduled pipeline runs the integration workflow on main
  2. The search allowlist and search tool CRUD tests POST /v1/search/<tool> and get {"object": "search", "results": [...], "provider_metadata": {}}
  3. The tests expected no provider_metadata key, so they fail

After: the same calls pass

  1. The same pipeline runs the integration workflow on this branch
  2. The same POST /v1/search/<tool> returns the same envelope
  3. The tests expect exactly that envelope and pass

CircleCI

Red on main in scheduled pipeline 91428 at f5d6e89, jobs integration-management 2265272 and integration-management-replica 2265273

The failing test ids are tests/integration/authorization/test_search_tool_allowlist.py::test_search_tool_allowlist_refuses_other_tools_before_any_upstream_call[key], the same test with [team], and tests/integration/management/test_search_tool_crud.py::test_search_tool_create_update_delete_is_read_back_and_applied_without_restart

They first failed in scheduled pipeline 91412 at f4347d4 and passed in 91411 at 1ef59fa. The culprit in that range is ca0ec62 from #47423, which intentionally returns every Exa top-level key except results as SearchResponse.provider_metadata. The SDK and wire tests it added already expect the field, but these two proxy tests still pinned the old shape. This PR updates only those assertions to the new envelope

PR branch pipeline 91431 at f42d3c3. All three test ids pass there in integration-management 2265329 and integration-management-replica 2265341. Both jobs stay red for the deferred causes below. Every other failure in them is also red on main in 91428 or in the two scheduled runs before it, and no job green on main went red

Deferred to their own PRs or later runs. The double spend from #47192 behind most integration-accounting, integration-mcp, integration-cost and integration-management budget failures is #47510. The TypeSafe decisions cost and Arize span failures are #47508. The reasoning_effort=none 400s on gpt-5 in test_cursor_responses_wire and test_azure_reasoning_effort_none_wire after #43935 need a product call. Passthrough spend after #44795, Responses WebSocket turn admission after #45727, Gemini TTS billing after #44551, and the remaining single failures wait for the next run. Those jobs stay red on this branch for the same reasons they are red on main

Pre-Submission checklist

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

  • I have added meaningful tests
  • The handful of test files covering my change pass locally, e.g. 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
  • My PR passes all required CI/CD checks (e.g., lint, schema.d.ts sync check, etc.)
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • Every automated review on my PR's latest commit has finished, and I have addressed or replied to each of its findings before requesting a maintainer review

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

This is a test-only change, so the proof is the three previously red test ids passing in the PR branch CircleCI pipeline linked above

Type

✅ Test

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

  • f42d3c3 passes /live-pr-risk

Link to Devin session: https://app.devin.ai/sessions/b0cfe4686d774b28a561d2416418ee27
Open in Devin Desktop: https://app.devin.ai/desktop/session/b0cfe4686d774b28a561d2416418ee27?variant=devin
Requested by: @mateo-berri


Note

Low Risk
Assertions-only; no runtime or API behavior changes in this PR.

Overview
Test-only fix so integration tests match the /v1/search response shape introduced in #47423.

Successful search assertions in test_search_tool_allowlist.py and test_search_tool_crud.py now require "provider_metadata": {} alongside object and results. Full-response equality is unchanged—only the expected envelope is updated so scheduled CI stops failing on the missing key.

Reviewed by Cursor Bugbot for commit f42d3c3. Bugbot is set up for automated code reviews on this repo. Configure here.

… after #47423

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@mateo-berri

Copy link
Copy Markdown
Contributor Author

@litereview code-review

@codecov

codecov Bot commented Oct 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@litereview

litereview Bot commented Oct 20, 2026

Copy link
Copy Markdown

✅ code-review

5/5 · Ready for human review

Scope: full · Full PR review.

No correctness findings.

The PR changes only test assertions. Both proxy tests now expect the /v1/search envelope that ExaAISearchConfig.transform_search_response returns since #47423. With an upstream body of {"results": []}, that envelope carries provider_metadata: {} (litellm/llms/exa_ai/search/transformation.py:213). The tests still compare the whole response for exact equality. I ran all three affected test IDs locally through the repository harness, and they passed.

Checks and execution details
  • Passed · Real testing evidence (required): Not applicable: no LLM translation changes in the scoped paths. The diff touches only tests/integration/authorization/test_search_tool_allowlist.py and tests/integration/management/test_search_tool_crud.py. Nothing under litellm/llms/** or litellm/litellm_core_utils/prompt_templates/** changed.
  • Passed · Compatibility requirements (required): Test-only change. No supported API, configuration, default, persisted data, or public behavior changes in this PR. The provider_metadata addition shipped in fix(exa): return highlights, highlight scores, score and the response envelope from Exa search #47423, which is outside this diff. A breaking-change marker is not required.
  • Passed · Changed behavior and result consistency (required): Read tests/AGENTS.md, tests/integration/AGENTS.md, and tests/integration/README.md. Traced the /v1/search/{tool} route to the Exa transform_search_response in litellm/llms/exa_ai/search/transformation.py:205-215. That function builds provider_metadata from every top-level upstream key except results. Both test peers return {"results": [...]} with no other top-level keys, so the expected {} matches. Exact equality is kept, so no assertion was weakened. Grepped for other proxy-level assertions that pin the old envelope. tests/integration/compatibility/test_missing_body_param_status.py:371 uses {"object":"search","results":[]} only as a scripted upstream body, and that test checks only object == "search", so it is unaffected.
  • Passed · Local run of the three affected integration tests (optional): Ran PATH=.venv/bin:$PATH DATABASE_URL=postgresql://postgres:postgres@​localhost:5432/postgres REDIS_HOST=localhost REDIS_PORT=6379 INTEGRATION_WORKERS=2 INTEGRATION_MASTER_KEY=sk-1234 .venv/bin/python tests/integration/run.py management --results /tmp/res2 tests/integration/authorization/test_search_tool_allowlist.py::test_search_tool_allowlist_refuses_other_tools_before_any_upstream_call tests/integration/management/test_search_tool_crud.py after prisma generate. Result: 3 passed in 83.26s ([key], [team], and the CRUD test).

View review · Reviewed f42d3c31903e

@mateo-berri

Copy link
Copy Markdown
Contributor Author

@greptileai

@greptile-apps

greptile-apps Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] This test-only change appears safe to merge

Summary

Updates two integration tests to expect provider_metadata: {} in successful Exa search responses

  • Search tests expect the Exa metadata field in proxy responses.

Reviews (1) · Last reviewed commit: "test(integration): expect the Exa search..." · Reviewed by Greptile

@mateo-berri

Copy link
Copy Markdown
Contributor Author

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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 f42d3c3. Configure here.

@mateo-berri
mateo-berri enabled auto-merge (squash) October 20, 2026 15:28
@mateo-berri

Copy link
Copy Markdown
Contributor Author

@litellm-stampbot

@kerry-berri

kerry-berri commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

litellm-stampbot: risk low

Approved at f42d3c3.

Rules (stampbot/risk_rules.yml):

  • low: 0 changed source lines (only tests, docs, cookbook, markdown or the cost map changed), approved without asking Bugbot or the judge

Judge: skipped, the rules alone decided.

Pushes do not re-run this check. Comment @litellm-stampbot again to re-check the new head.

@kerry-berri kerry-berri added the risk:low Small, isolated, low-risk change label Oct 20, 2026

@kerry-berri kerry-berri left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Low risk by rule and by judgement at f42d3c3

@mateo-berri
mateo-berri merged commit 047cb4a into main Oct 20, 2026
160 of 171 checks passed
@mateo-berri
mateo-berri deleted the litellm_circleci_heal_search_envelope branch October 20, 2026 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:low Small, isolated, low-risk change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants