Skip somethings for chats idk

This commit is contained in:
Alex Gleason committed 2025-12-03 01:27:37 -06:00
1 parent d3187d8c77
commit 2c42efd4e1
3 files changed
+44 -22

No files matched your search

+5 -3
View File
@@ -14,6 +14,7 @@ interface UseAIChatSessionOptions {
onUpdateMetadata?: (title: string, description: string) => void;
onAIError?: (error: Error) => void;
workingDir?: string; // Optional working directory (for chats)
isChat?: boolean; // Whether this is a chat session (vs a project session)
}
interface StreamingMessage {
@@ -34,7 +35,8 @@ export function useAIChat({
maxSteps = 50,
onUpdateMetadata,
onAIError,
workingDir
workingDir,
isChat
}: UseAIChatSessionOptions) {
const sessionManager = useSessionManager();
const { isConfigured } = useAISettings();
@@ -48,14 +50,14 @@ export function useAIChat({
const initSession = useCallback(async () => {
// Load or update session
const session = await sessionManager.loadSession(projectId, tools, customTools, maxSteps, workingDir);
const session = await sessionManager.loadSession(projectId, tools, customTools, maxSteps, workingDir, isChat);
// Initialize individual state variables from existing session
setMessages([...session.messages]);
setStreamingMessage(session.streamingMessage ? { ...session.streamingMessage } : undefined);
setIsLoading(session.isLoading);
setTotalCost(session.totalCost || 0);
setLastInputTokens(session.lastInputTokens || 0);
}, [sessionManager, projectId, tools, customTools, maxSteps, workingDir]);
}, [sessionManager, projectId, tools, customTools, maxSteps, workingDir, isChat]);
// Initialize session
useEffect(() => {