You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The auto model router re-resolves on every user message: plan_turn_route (crates/tui/src/turn_route_plan.rs:143) runs the classifier (:146-166) per turn, and [auto] cross_provider (#4411) allows hopping providers turn-to-turn.
Every provider/model change forces a declared prefix-cache re-pin (crates/tui/src/core/engine.rs:7341-7374) — a guaranteed full cache miss on the next turn. With cache reads priced far below fresh input on every major provider, a per-turn auto route that switches models can cost more than the cheap model saves. Auto routing must be session-sticky: route once, stay bound.
Change
crates/tui/src/turn_route_plan.rs:143 — consult the session binding first. If bound and the binding still revalidates against ModelInventory (crates/tui/src/model_inventory.rs:77 — credential present, provider runnable, readiness), skip the classifier entirely and resolve the bound provider+model.
crates/tui/src/session_manager.rs:935 — promote SavedSession.last_auto_route (today: write-only provenance, set at tui/ui/event_loop.rs:2584 / dispatch.rs:933) to a load-bearing binding read at plan time. Already Option with serde defaults, so migration-safe.
Rebind only on: binding fails revalidation, the bound route errors at dispatch (client.rs:1421 / route/resolver.rs:218 re-resolution), or the user explicitly changes model/provider (already a declared re-pin).
[auto] cross_provider becomes a bind-time scope, not a per-turn permission: it widens the candidate set when the binding is created, not afterwards.
Already true, keep it that way
Transport retries and stream-resume never re-plan or switch provider (client.rs:3570, turn_loop.rs:1786-1941) — failure handling stays on the bound route.
No prefix-cache re-pin occurs between turns that stay on the binding (verify via PrefixStabilityManager drift attribution, crates/core/src/prefix_cache.rs).
Removing the bound provider credential and resuming the session triggers exactly one rebind, receipted.
Explicit user model change busts the binding deliberately and is recorded as such.
Problem
The auto model router re-resolves on every user message:
plan_turn_route(crates/tui/src/turn_route_plan.rs:143) runs the classifier (:146-166) per turn, and[auto] cross_provider(#4411) allows hopping providers turn-to-turn.Every provider/model change forces a declared prefix-cache re-pin (
crates/tui/src/core/engine.rs:7341-7374) — a guaranteed full cache miss on the next turn. With cache reads priced far below fresh input on every major provider, a per-turn auto route that switches models can cost more than the cheap model saves. Auto routing must be session-sticky: route once, stay bound.Change
crates/tui/src/turn_route_plan.rs:143— consult the session binding first. If bound and the binding still revalidates againstModelInventory(crates/tui/src/model_inventory.rs:77— credential present, provider runnable, readiness), skip the classifier entirely and resolve the bound provider+model.crates/tui/src/session_manager.rs:935— promoteSavedSession.last_auto_route(today: write-only provenance, set attui/ui/event_loop.rs:2584/dispatch.rs:933) to a load-bearing binding read at plan time. AlreadyOptionwith serde defaults, so migration-safe.client.rs:1421/route/resolver.rs:218re-resolution), or the user explicitly changes model/provider (already a declared re-pin).[auto] cross_providerbecomes a bind-time scope, not a per-turn permission: it widens the candidate set when the binding is created, not afterwards.Already true, keep it that way
Transport retries and stream-resume never re-plan or switch provider (
client.rs:3570,turn_loop.rs:1786-1941) — failure handling stays on the bound route.Acceptance
model = "auto"makes at most one classifier call per binding; subsequent turns showrouting_source: StickyBinding(feat(auto): receipts — record route bindings, rebinds, and sticky vs fresh routing source #6253).PrefixStabilityManagerdrift attribution,crates/core/src/prefix_cache.rs).