Context
RoutingDecisionEngine::decide_route() uses tokio::task::block_in_place + block_on() to call async TelemetryStore::model_performance() per candidate model (routing.rs:362-370).
This blocks a tokio worker thread (25% capacity loss with 4 threads), panics on single-thread runtime, and acquires the read lock N times when once would suffice.
Proposed fix
Make decide_route() async (caller spawn_agent() is already async), or pre-fetch ModelPerformanceSnapshot data and pass it in.
Acceptance criteria
- No
block_in_place or block_on in decide_route
- Tests work with default
#[tokio::test]
- All existing tests pass
Refs #536 (Gitea), Refs #523
Context
RoutingDecisionEngine::decide_route()usestokio::task::block_in_place+block_on()to call asyncTelemetryStore::model_performance()per candidate model (routing.rs:362-370).This blocks a tokio worker thread (25% capacity loss with 4 threads), panics on single-thread runtime, and acquires the read lock N times when once would suffice.
Proposed fix
Make
decide_route()async (callerspawn_agent()is already async), or pre-fetchModelPerformanceSnapshotdata and pass it in.Acceptance criteria
block_in_placeorblock_onindecide_route#[tokio::test]Refs #536 (Gitea), Refs #523