From 62a3713e1e55e98314e25abbeafa34b046db7025 Mon Sep 17 00:00:00 2001 From: Mikhail Date: Mon, 24 Aug 2026 19:02:05 +0300 Subject: [PATCH] fix: keep structured model inventory on fast path --- cmd/core-runtime/cognitive_interpretation.go | 8 +++++++- cmd/core-runtime/cognitive_interpretation_test.go | 6 +++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/cmd/core-runtime/cognitive_interpretation.go b/cmd/core-runtime/cognitive_interpretation.go index cccb20e..357620e 100644 --- a/cmd/core-runtime/cognitive_interpretation.go +++ b/cmd/core-runtime/cognitive_interpretation.go @@ -75,7 +75,13 @@ func shouldRequestSemanticInterpretation(result interactiondomain.SemanticResult if result.Interpretation.Clarification == interaction.ClarificationRequired { return false } - if result.NeedsCognition || result.InformationRequestKind != "" || len(result.CapabilityHints) > 0 { + // Structured, read-only information intents already have a semantic owner + // in core-runtime. Sending them through the slower advisory interpretation + // path only adds latency and can make a healthy runtime look unavailable. + if result.InformationRequestKind != "" { + return false + } + if result.NeedsCognition || len(result.CapabilityHints) > 0 { return true } if result.Interpretation.Applicability != interaction.SemanticApplicable { diff --git a/cmd/core-runtime/cognitive_interpretation_test.go b/cmd/core-runtime/cognitive_interpretation_test.go index d14563d..f7d1b5c 100644 --- a/cmd/core-runtime/cognitive_interpretation_test.go +++ b/cmd/core-runtime/cognitive_interpretation_test.go @@ -36,7 +36,7 @@ func TestOperationalQuestionStillUsesStrictInterpretation(t *testing.T) { } } -func TestDirectiveAndInventoryPreferMeaningInterpretationEvenWhenDeterministicLooksApplicable(t *testing.T) { +func TestStructuredInventoryUsesDirectReadOnlySemanticRoute(t *testing.T) { result := interactiondomain.SemanticResult{ Interpretation: interaction.UtteranceInterpretation{ SpeechAct: interaction.SpeechActDirective, @@ -45,8 +45,8 @@ func TestDirectiveAndInventoryPreferMeaningInterpretationEvenWhenDeterministicLo }, InformationRequestKind: interaction.InformationRequestCognitiveModelInventory, } - if !shouldRequestSemanticInterpretation(result) { - t.Fatal("model inventory directive must be interpreted by meaning, not only token reflex") + if shouldRequestSemanticInterpretation(result) { + t.Fatal("structured model inventory must use the direct read-only semantic route") } } -- 2.54.0