From a0e5ae8a28fafe1b92cbf807d128bb66bc88a6f4 Mon Sep 17 00:00:00 2001 From: spencrmartin Date: Wed, 3 Dec 2025 15:15:21 -0500 Subject: [PATCH] fix: Replace getSessionHistory with getSession API call The API was updated and getSessionHistory no longer exists. Updated all imports and calls to use getSession instead. Also updated response field from sessionId to session_id to match new API. --- ui/desktop/src/hooks/useMessageStream.ts | 4 ++-- ui/desktop/src/sessions.ts | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ui/desktop/src/hooks/useMessageStream.ts b/ui/desktop/src/hooks/useMessageStream.ts index 5fa07d46a9..9d84c583b9 100644 --- a/ui/desktop/src/hooks/useMessageStream.ts +++ b/ui/desktop/src/hooks/useMessageStream.ts @@ -1,7 +1,7 @@ import { useCallback, useEffect, useId, useReducer, useRef, useState } from 'react'; import useSWR from 'swr'; import { createUserMessage, hasCompletedToolCalls, Message } from '../types/message'; -import { getSessionHistory } from '../api'; +import { getSession } from '../api'; import { ChatState } from '../types/chatState'; let messageIdCounter = 0; @@ -396,7 +396,7 @@ export function useMessageStream({ ?.session_id as string; if (sessionId) { try { - const sessionResponse = await getSessionHistory({ + const sessionResponse = await getSession({ path: { session_id: sessionId }, }); diff --git a/ui/desktop/src/sessions.ts b/ui/desktop/src/sessions.ts index a88e5351ea..fc217ea413 100644 --- a/ui/desktop/src/sessions.ts +++ b/ui/desktop/src/sessions.ts @@ -1,5 +1,5 @@ import { Message } from './types/message'; -import { getSessionHistory, listSessions, SessionInfo } from './api'; +import { getSession, listSessions, SessionInfo } from './api'; import { convertApiMessageToFrontendMessage } from './components/context_management'; import { getApiUrl } from './config'; @@ -138,13 +138,13 @@ export async function fetchSessions(): Promise { */ export async function fetchSessionDetails(sessionId: string): Promise { try { - const response = await getSessionHistory({ + const response = await getSession({ path: { session_id: sessionId }, }); - // Convert the SessionHistoryResponse to a SessionDetails object + // Convert the SessionResponse to a SessionDetails object return { - session_id: response.data.sessionId, + session_id: response.data.session_id, metadata: ensureWorkingDir(response.data.metadata), messages: response.data.messages.map((message) => convertApiMessageToFrontendMessage(message, true, true)