Files
6krrt/tests/test_routing_profiles_integration.py
adlee-was-taken 6ecd134e43 fix(api): /route and /dispatch honour routing.default_profile
Both endpoints resolved `req.profile or "default"` -- the literal
built-in profile named "default" -- and passed a non-None profile_obj,
so route()'s cfg.routing.default_profile fallback was dead code on those
paths. Only `auto` went through _resolve_profile, which does honour it.

Those were the same thing until an operator set default_profile. After
that, /route -- the documented no-spend probe of "what would the router
pick" -- answered for a profile the router was not using, and wrote that
profile's name into route_decisions.

Found live, and the way it presented is the reason to fix it rather than
document it. With default_profile = "MiMo Test":

  POST /route                 -> profile "default",   deepseek-v4-flash
  POST /v1/chat/completions   -> profile "MiMo Test", xiaomi/mimo-v2.5
  (same task, same instant)

Read back from the decisions history that looks like a broken profile
overlay. The overlay was fine; the probe was lying, and it briefly
convinced me too.

An explicit profile still wins, so a caller can still probe one
deliberately, including the built-in called "default" --
test_an_explicit_profile_still_wins_over_the_configured_default pins
that the narrowing stays narrow.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VRQXz5SYZYVWscxS1QqF6U
2026-09-09 21:19:09 -04:00

30 KiB