From df3ee0bbe008924d26368973dd21e9415aaff623 Mon Sep 17 00:00:00 2001 From: kami Date: Fri, 12 Jun 2026 13:56:28 +0400 Subject: [PATCH] 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. --- .../com/correx/core/inference/DefaultInferenceRouter.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/inference/src/main/kotlin/com/correx/core/inference/DefaultInferenceRouter.kt b/core/inference/src/main/kotlin/com/correx/core/inference/DefaultInferenceRouter.kt index f4dde2d5..3fa819d1 100644 --- a/core/inference/src/main/kotlin/com/correx/core/inference/DefaultInferenceRouter.kt +++ b/core/inference/src/main/kotlin/com/correx/core/inference/DefaultInferenceRouter.kt @@ -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",