fix(inference): narration model_id accepts bare provider id from TOML
The router matched only the adapter-prefixed registry id (llama-cpp:narrator) while the operator's [router.narration] model_id naturally repeats the bare [[providers]] id (narrator), so the match always failed and narration silently fell back to the slow main model. Match either form.
This commit is contained in:
@@ -69,7 +69,11 @@ class DefaultInferenceRouter(
|
||||
|
||||
val all = registry.listAll()
|
||||
val healthy = all.filter { cachedHealth(it) !is ProviderHealth.Unavailable }
|
||||
val matched = healthy.firstOrNull { it.id.value == modelId }
|
||||
// Registry ids are adapter-prefixed ("llama-cpp:narrator") while the operator's TOML
|
||||
// declares the bare id ("narrator") — accept either form.
|
||||
val matched = healthy.firstOrNull {
|
||||
it.id.value == modelId || it.id.value.substringAfter(':') == modelId
|
||||
}
|
||||
if (matched == null) {
|
||||
log.warn(
|
||||
"narration model_id '{}' matched no healthy provider — falling back to capability routing",
|
||||
|
||||
Reference in New Issue
Block a user