Always load durable user conversation context #298

Merged
m merged 2 commits from codex/chat-semantic-inventory into main 2026-08-24 23:53:43 +00:00
+5 -2
View File
@@ -513,9 +513,12 @@ func main() {
var conversationHistory []interaction.HumanUtterance
if request.ConversationID != "" {
conversationHistory, _ = interactionRepository.Utterances(r.Context(), conversation.ID)
} else {
conversationHistory, _ = interactionRepository.RecentUtterancesForPrincipal(r.Context(), session.ActorID, session.PrincipalID, 64)
}
// Keep durable user context available even when the web client carries a
// conversation ID; a new or rotated conversation must not erase learned
// preferences.
recentUserHistory, _ := interactionRepository.RecentUtterancesForPrincipal(r.Context(), session.ActorID, session.PrincipalID, 64)
conversationHistory = append(conversationHistory, recentUserHistory...)
if request.ConversationID != "" && interactiondomain.IsRetryRequest(utterance.Content) {
if len(conversationHistory) > 0 {
for index := len(conversationHistory) - 1; index >= 0; index-- {