litellm/tests/unit/proxy/lens/test_reviews.py
moe-berri 5147aefa8b
fix(lens): reuse trace reviews and consolidate findings across runs (#44778)
* fix(lens): reuse trace reviews and consolidate findings across runs

* chore: sync schema.prisma copies from root

* fix(lens): preserve partial reviews and bound budget admission

* fix(lens): resolve CI regressions and clarify reused runs

* test(lens): exercise review reuse in worker container smoke

* fix(lens): show actual reviews when a run finishes

* fix(lens): distinguish reuse plans and stop blocked scans

* fix(lens): retain partial findings when model requests stop

* docs(lens): clarify budget edits during active runs

* fix(lens): publish findings only after reconciliation completes

* fix(lens): guide insufficient-budget runs to budget settings

* fix(lens): renew budget holds and bound admission waits

* fix(lens): preserve provider errors during budget cleanup

* fix(ci): update PgBouncer and sharp for current builds

* fix(lens): serialize settlement and fence review checkpoints

* fix(lens): defer generated Prisma client type import

* test(lens): verify checkpoint and progress rollback together

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-10-06 12:09:56 -07:00

26 lines
992 B
Python

from typing import Final
from litellm.proxy.lens.models import Check
from litellm.proxy.lens.reviews import criteria_key
from tests.unit.proxy.lens.test_state import lens
def test_only_evaluation_changes_invalidate_reviews() -> None:
settings: Final = lens().settings
operations: Final = settings.model_copy(
update={
"name": "Renamed",
"monthly_budget": 200,
"interval_minutes": 30,
"enabled": False,
"concurrency": 2,
}
)
assert criteria_key(operations) == criteria_key(settings)
assert criteria_key(settings.model_copy(update={"context": "Only inspect unrecovered errors"})) != criteria_key(
settings
)
assert criteria_key(
settings.model_copy(update={"checks": (Check(id="retries", instruction="Find all retries"),)})
) != criteria_key(settings)
assert criteria_key(settings.model_copy(update={"model": "another-analysis-model"})) != criteria_key(settings)