feat: add semantic chat route orchestration
CI / test (push) Successful in 55s
CI / test (pull_request) Successful in 55s

This commit is contained in:
m
2026-08-24 20:23:17 +03:00
parent 6394e45bf2
commit ac721216ea
3 changed files with 119 additions and 2 deletions
+7 -2
View File
@@ -512,6 +512,7 @@ func main() {
http.Error(w, "interpret chat message", http.StatusServiceUnavailable)
return
}
routePlan := buildChatRoutePlan(semantic)
cognitiveAttempted := false
cognitiveAvailable := true
semanticInterpretationRequested := shouldRequestSemanticInterpretation(semantic)
@@ -625,13 +626,17 @@ func main() {
needsCognition = false
}
researchBacked := false
if hasCapabilityHint(semantic.CapabilityHints, "WEB_RESEARCH") && semantic.Interpretation.Clarification != interaction.ClarificationRequired {
if hasChatRoute(routePlan, chatRouteResearch) && semantic.Interpretation.Clarification != interaction.ClarificationRequired {
if planID, idErr := ids.New(); idErr == nil {
result, researchErr := researchClient.SearchWeb(r.Context(), epistemics.WebSearchRequest{
researchCtx, cancelResearch := context.WithTimeout(r.Context(), 8*time.Second)
result, researchErr := researchClient.SearchWeb(researchCtx, epistemics.WebSearchRequest{
Plan: epistemics.ResearchPlan{ID: epistemics.ResearchPlanID("plan:" + planID), Question: utterance.Content, SourceClasses: []string{"web-search"}, FreshnessPolicy: "current"},
PropositionKey: "question:" + string(utterance.ID), Query: utterance.Content,
})
cancelResearch()
planningReply, researchBacked = renderResearchReply(result, researchErr)
// A failed source must not turn the complete conversation into a
// runtime failure or invite an unsupported local guess for a fact.
needsCognition = false
}
}