only enabled ai models in super admin

This commit is contained in:
2026-02-23 08:14:20 +00:00
parent d9b69c8209
commit e25f685b70
2 changed files with 5 additions and 11 deletions
@@ -12,7 +12,7 @@ import {
SelectValue,
} from '@/components/ui/select';
import { useSettings } from 'state/useSettings';
import { useVisiblePiModels, getProviderDisplayName, type ModelOption } from 'state/useModels';
import { useEnabledPiModels, getProviderDisplayName, type ModelOption } from 'state/useModels';
function buildGroups(models: ModelOption[]) {
const groups: Record<string, { id: string; name: string }[]> = {};
@@ -30,9 +30,11 @@ const NONE = '__none__';
export const AIModels = () => {
const { settings, saveSettings } = useSettings();
const piModels = useVisiblePiModels();
const piModels = useEnabledPiModels();
const [isSaving, setIsSaving] = useState(false);
console.log('[AIModels] enabledModels:', settings.ai?.enabledModels?.length, 'filtered:', piModels.length);
const [chatModel, setChatModel] = useState<string | null>(settings.chat.defaultModel);
const [projectModel, setProjectModel] = useState<string | null>(settings.chat.defaultProjectModel);
const [taskModel, setTaskModel] = useState<string | null>(settings.tasks.defaultModel);