Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

Revert "Fix: UI chat should pass pass_all_history_messages=false in 1.0 go" (#19618)

Wang Qi521d2647d71c
diff --git a/web/src/pages/next-chats/hooks/use-send-single-message.ts b/web/src/pages/next-chats/hooks/use-send-single-message.ts
index 76737df99f..5bb575249d 100644
--- a/web/src/pages/next-chats/hooks/use-send-single-message.ts
+++ b/web/src/pages/next-chats/hooks/use-send-single-message.ts
@@ -8,7 +8,6 @@ import {
import { useGetChatSearchParams } from '@/hooks/use-chat-request';
import { IMessage } from '@/interfaces/database/chat';
import api from '@/utils/api';
-import { useIsGoBackend } from '@/utils/backend-variant';
import { trim } from 'lodash';
import { useCallback, useEffect } from 'react';
import { useParams } from 'react-router';
@@ -33,7 +32,6 @@ export function useSendSingleMessage({
Pick<ReturnType<typeof useUploadFile>, 'files' | 'clearFiles'>) {
const { conversationId } = useGetChatSearchParams();
const { id: chatId } = useParams();
- const isGoBackend = useIsGoBackend();
const { send, answer, done } = useSendMessageWithSse();
@@ -88,10 +86,7 @@ export function useSendSingleMessage({
...(storeHistoryMessages === undefined
? {}
: { store_history_messages: storeHistoryMessages }),
- // The Go backend owns session history server-side and appends the
- // new question; the Python backend is overwritten with the
- // client-sent list.
- pass_all_history_messages: !isGoBackend,
+ pass_all_history_messages: true,
},
controller,
);
@@ -111,7 +106,6 @@ export function useSendSingleMessage({
setValue,
send,
controller,
- isGoBackend,
],
);
diff --git a/web/src/services/chat-completion-stream.ts b/web/src/services/chat-completion-stream.ts
index 5b9c817aa8..58b242daee 100644
--- a/web/src/services/chat-completion-stream.ts
+++ b/web/src/services/chat-completion-stream.ts
@@ -14,7 +14,6 @@ import { ResponseType } from '@/interfaces/database/base';
import { IMessage, Variable } from '@/interfaces/database/chat';
import api from '@/utils/api';
import { getAuthorization } from '@/utils/authorization-util';
-import { pickByBackend } from '@/utils/backend-variant';
import { EventSourceParserStream } from 'eventsource-parser/stream';
export type ChatCompletionStreamParams = {
@@ -70,9 +69,7 @@ export function requestChatCompletionStream(
chat_id: chatId,
session_id: sessionId,
messages,
- // The Go backend owns session history server-side and appends the new
- // question; the Python backend is overwritten with the client-sent list.
- pass_all_history_messages: pickByBackend({ go: false, python: true }),
+ pass_all_history_messages: true,
reasoning: Number(enableThinking),
internet: enableInternet,
...(temperature === undefined ? {} : { temperature }),