test(router): annotate the budget filter return values

The two helpers return the deployments the filter kept and the debug
string. Name that as a sequence of model-list entries.

Co-authored-by: abeed09 <abeed09@users.noreply.github.com>
This commit is contained in:
Cursor Agent 2026-09-26 04:25:44 +00:00
parent f370e7f342
commit 72e1c69e6d
No known key found for this signature in database

View file

@ -174,7 +174,7 @@ def _apply_budget_filter(
request_tags: Sequence[str],
spend_key: str,
spend: float,
):
) -> tuple[Sequence[DeploymentTypedDict], str]:
limiter: Final = RouterBudgetLimiting(dual_cache=DualCache(), provider_budget_config=None)
limiter.provider_budget_config = provider_budget
limiter.deployment_budget_config = deployment_budget
@ -190,7 +190,7 @@ def _apply_budget_filter(
)
def _filter_one(scope: _Scope, config: BudgetConfig, spend: float):
def _filter_one(scope: _Scope, config: BudgetConfig, spend: float) -> tuple[Sequence[DeploymentTypedDict], str]:
match scope:
case "provider":
return _apply_budget_filter(