Add function_id tracking and enable JSON mode for all AI functions
This commit is contained in:
@@ -19,17 +19,19 @@ export interface UseProgressModalReturn {
|
||||
isOpen: boolean;
|
||||
title: string;
|
||||
taskId: string | null;
|
||||
openModal: (taskId: string, title: string) => void;
|
||||
openModal: (taskId: string, title: string, functionId?: string) => void;
|
||||
updateTaskId: (taskId: string) => void;
|
||||
closeModal: () => void;
|
||||
setError: (errorMessage: string) => void;
|
||||
reset: () => void;
|
||||
functionId?: string; // AI function ID for tracking
|
||||
}
|
||||
|
||||
export function useProgressModal(): UseProgressModalReturn {
|
||||
const [isOpen, setIsOpen] = useState(false);
|
||||
const [taskId, setTaskId] = useState<string | null>(null);
|
||||
const [title, setTitle] = useState('');
|
||||
const [functionId, setFunctionId] = useState<string | undefined>(undefined);
|
||||
const [progress, setProgress] = useState<ProgressState>({
|
||||
percentage: 0,
|
||||
message: 'Initializing...',
|
||||
@@ -532,7 +534,7 @@ export function useProgressModal(): UseProgressModalReturn {
|
||||
};
|
||||
}, [taskId, isOpen]);
|
||||
|
||||
const openModal = useCallback((newTaskId: string, newTitle: string) => {
|
||||
const openModal = useCallback((newTaskId: string, newTitle: string, newFunctionId?: string) => {
|
||||
// Clear any existing transition timeout
|
||||
if (stepTransitionTimeoutRef.current) {
|
||||
clearTimeout(stepTransitionTimeoutRef.current);
|
||||
@@ -542,6 +544,7 @@ export function useProgressModal(): UseProgressModalReturn {
|
||||
currentStepRef.current = null;
|
||||
setTaskId(newTaskId);
|
||||
setTitle(newTitle);
|
||||
setFunctionId(newFunctionId);
|
||||
setIsOpen(true);
|
||||
setProgress({
|
||||
percentage: 0,
|
||||
@@ -610,6 +613,7 @@ export function useProgressModal(): UseProgressModalReturn {
|
||||
reset,
|
||||
title, // Expose title for use in component
|
||||
taskId, // Expose taskId for use in ProgressModal
|
||||
functionId, // Expose functionId for use in ProgressModal
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user