feat: add unified response history session management across Claude, Gemini, and OpenAI API backends

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
CJACK
2026-05-03 17:24:38 +08:00
parent 5e55cf36d8
commit c099a6f7bf
28 changed files with 776 additions and 57 deletions

View File

@@ -10,6 +10,9 @@ import {
VIEW_MODE_KEY,
} from './chatHistoryUtils'
const LIST_REFRESH_MS = 1500
const STREAMING_DETAIL_REFRESH_MS = 750
export default function ChatHistoryContainer({ authFetch, onMessage }) {
const { t, lang } = useI18n()
const apiFetch = authFetch || fetch
@@ -136,7 +139,7 @@ export default function ChatHistoryContainer({ authFetch, onMessage }) {
if (!autoRefreshReady || limit === DISABLED_LIMIT) return undefined
const timer = window.setInterval(() => {
loadList({ mode: 'silent', announceError: false })
}, 5000)
}, LIST_REFRESH_MS)
return () => window.clearInterval(timer)
}, [autoRefreshReady, limit])
@@ -144,7 +147,7 @@ export default function ChatHistoryContainer({ authFetch, onMessage }) {
if (!autoRefreshReady || !selectedId || selectedSummary?.status !== 'streaming') return undefined
const timer = window.setInterval(() => {
loadDetail(selectedId, { announceError: false })
}, 1000)
}, STREAMING_DETAIL_REFRESH_MS)
return () => window.clearInterval(timer)
}, [autoRefreshReady, selectedId, selectedSummary?.status])