fix: keep model inventory on fast path #271

Merged
m merged 2 commits from codex/chat-semantic-inventory into main 2026-08-24 16:07:53 +00:00
2 changed files with 10 additions and 4 deletions
+7 -1
View File
@@ -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 {
@@ -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")
}
}