Skip to content

Commit c208e78

Browse files
ILindsleyclaude
andcommitted
Fix chat history ordering to match backend sort order
The backend now returns history entries in chronological order (oldest first), so the client-side .reverse() was displaying them backwards. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent ad13068 commit c208e78

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/hooks/use-chat-runtime.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,9 @@ export function useChatRuntime() {
8282
const history: ChatHistoryResponse = await response.json();
8383

8484
// Convert history entries to ChatMessage format
85-
// History is newest-first, so reverse for chronological order
8685
const historyMessages: ChatMessage[] = [];
87-
const reversedEntries = [...history.entries].reverse();
8886

89-
reversedEntries.forEach((entry, i) => {
87+
history.entries.forEach((entry, i) => {
9088
// Add user message
9189
historyMessages.push({
9290
id: `history-user-${i}`,

0 commit comments

Comments
 (0)