Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,8 @@ private int countJsonArray(String json) {

/**
* Build ConversationContext from Redis session history.
* Each history entry is a JSON string of {userQuery, agentSummary, timestamp}.
* Each history entry is a JSON string of {userQuery, agentOutput, timestamp},
* as persisted by {@link SessionStore#saveChatEntry}.
* If history is empty or an error occurs, returns an empty context.
*/
private ConversationContext buildConversationContext(String sessionId, String currentQuery) {
Expand All @@ -280,7 +281,7 @@ private ConversationContext buildConversationContext(String sessionId, String cu
try {
com.fasterxml.jackson.databind.JsonNode node = objectMapper.readTree(entry);
String query = node.path("userQuery").asText(null);
String summary = node.path("agentSummary").asText(null);
String summary = node.path("agentOutput").asText(null);
String ts = node.path("timestamp").asText(Instant.now().toString());
if (query != null) {
messages.add(new ConversationContext.ChatMessage(query, summary, ts));
Expand Down