litellm/tests/test_litellm/router_strategy
tin-berri 7c621b3141
fix(auto-router): accept every reminder marker pair a harness emits (#36029)
* fix(auto-router): accept every reminder marker pair a harness emits

reminder_markers held one (open, close) pair, so a harness that wraps
injected context differently per agent type only got the slice of traffic
using the configured envelope stripped. Every other agent type kept hitting
the original bug: its reminder-only turn never stripped to empty, won
"newest human ask", and the harness blob got classified in place of the
real question, choosing the tier and therefore the spend.

The field now takes a list of ReminderMarkerPair, following the
KeywordTierRule pattern already in this file so each pair validates itself
and errors point at reminder_markers.N.close rather than a bare index.

Blocks from different pairs can nest, which the gap construction could not
handle: resuming the kept text at an inner block's end walks back inside
the enclosing block and leaks its remainder. Running the block ends through
a maximum collapses nested and overlapping spans without a separate merge
pass, and stays linear in block count, which a fold over a growing tuple
of merged spans would not.

A single pair's ends already increase, so the maximum is the identity and
the default path is byte-identical: verified against the shipped function
over 200k generated inputs, and every existing reminder test passes
unchanged. The prior single-pair config shape is rejected loudly at
startup and at /model/new rather than silently stripping nothing.

* docs(auto-router): document reminder_markers in the complexity router README

* chore(ui): regenerate dashboard API types for the reminder_markers shape

---------

Co-authored-by: Abhimanyu Kapur <38531241+akapur99@users.noreply.github.com>
2026-08-05 21:03:36 -07:00
..
adaptive_router feat(router): record why the auto-router picked a tier and show it in the logs (#35016) 2026-07-30 11:55:10 -07:00
test_auto_router.py fix(auto-router): stop the embedding model's context window from failing long requests (#35956) 2026-08-05 14:47:40 -07:00
test_base_routing_strategy.py [Fix] Fix test failures and Docker build from pinned dependency upgrade 2026-04-01 09:43:33 -07:00
test_budget_limiter_hotpath.py fix(router): enforce deployment budgets for dynamically added models (#29273) 2026-05-29 19:43:14 -07:00
test_complexity_router.py fix(auto-router): accept every reminder marker pair a harness emits (#36029) 2026-08-05 21:03:36 -07:00
test_lar1_routing.py chore: litellm oss staging (#31185) 2026-06-26 09:17:44 -07:00
test_litellm_encoder.py fix(auto-router): stop the embedding model's context window from failing long requests (#35956) 2026-08-05 14:47:40 -07:00
test_lowest_latency.py test(router_strategy): cover chat-path normalization branches in both handlers 2026-07-23 08:36:48 +10:00
test_quality_router.py feat(router): record why the auto-router picked a tier and show it in the logs (#35016) 2026-07-30 11:55:10 -07:00
test_router_routing_groups.py fix(router): honor per-request routing_strategy from key/team router_settings (#33429) 2026-07-16 13:36:03 -07:00
test_router_routing_plugins.py feat(router): resolve auto-router routing plugins from proxy YAML config (#33251) 2026-07-14 21:27:14 -07:00
test_router_tag_regex_routing.py Litellm ishaan march30 (#24887) (#25151) 2026-04-04 14:44:07 -07:00
test_router_tag_routing.py fix(router): apply team/key enable_tag_filtering to tag routing (#33436) 2026-07-16 14:41:24 -07:00
test_savings_baseline.py feat(spend): derive a default auto-router savings baseline from the hardest tier (#35907) 2026-08-04 22:36:45 -07:00