🐛 fix: Agent automatic completion meta not working error (#8003)

* 🐛fix:Agent automatic completion meta not working error

* chore: fix lint
This commit is contained in:
𝑾𝒖𝒙𝒉
2025-05-31 11:51:36 +08:00
committed by GitHub
parent 2ae0e9ed56
commit c5307bf969
5 changed files with 26 additions and 14 deletions
@@ -2,10 +2,12 @@ import { ColorSwatches, NeutralColors, findCustomThemeName, neutralColors } from
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
const ThemeSwatchesNeutral = memo<{
interface IProps {
onChange?: (v: NeutralColors) => void;
value?: NeutralColors;
}>(({ value, onChange }) => {
}
const ThemeSwatchesNeutral = memo<IProps>(({ value, onChange }) => {
const { t } = useTranslation('color');
const handleSelect = (v: any) => {
@@ -2,10 +2,12 @@ import { ColorSwatches, PrimaryColors, findCustomThemeName, primaryColors } from
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
const ThemeSwatchesPrimary = memo<{
interface IProps {
onChange?: (v: PrimaryColors) => void;
value?: PrimaryColors;
}>(({ onChange, value }) => {
}
const ThemeSwatchesPrimary = memo<IProps>(({ onChange, value }) => {
const { t } = useTranslation('color');
const handleSelect = (v: any) => {
@@ -1,6 +1,7 @@
'use client';
import { Button, Form, type FormGroupItemType, type FormItemProps, Tooltip } from '@lobehub/ui';
import { useUpdateEffect } from 'ahooks';
import isEqual from 'fast-deep-equal';
import { Wand2 } from 'lucide-react';
import { memo, useState } from 'react';
@@ -30,6 +31,10 @@ const AgentMeta = memo(() => {
const meta = useStore(selectors.currentMetaConfig, isEqual);
const [background, setBackground] = useState(meta.backgroundColor);
useUpdateEffect(() => {
form.setFieldsValue(meta);
}, [meta]);
if (isInbox) return;
const basic = [
+10 -9
View File
@@ -4,7 +4,7 @@ import type { ItemType } from 'antd/es/menu/interface';
import { LucideArrowRight, LucideBolt } from 'lucide-react';
import Link from 'next/link';
import { useRouter } from 'next/navigation';
import { PropsWithChildren, memo, useMemo } from 'react';
import { type ReactNode, memo, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
import { Flexbox } from 'react-layout-kit';
@@ -40,14 +40,15 @@ const useStyles = createStyles(({ css, prefixCls }) => ({
const menuKey = (provider: string, model: string) => `${provider}-${model}`;
const ModelSwitchPanel = memo<
PropsWithChildren<{
onOpenChange?: (open: boolean) => void;
open?: boolean;
setUpdating?: (updating: boolean) => void;
updating?: boolean;
}>
>(({ children, setUpdating, onOpenChange, open }) => {
interface IProps {
children?: ReactNode;
onOpenChange?: (open: boolean) => void;
open?: boolean;
setUpdating?: (updating: boolean) => void;
updating?: boolean;
}
const ModelSwitchPanel = memo<IProps>(({ children, setUpdating, onOpenChange, open }) => {
const { t } = useTranslation('components');
const { styles, theme } = useStyles();
const [model, provider, updateAgentConfig] = useAgentStore((s) => [
@@ -141,7 +141,9 @@ const MCPManifestForm = ({ form, isEditMode }: MCPManifestFormProps) => {
...(mcpType === 'http' ? [HTTP_URL_KEY] : [STDIO_COMMAND, STDIO_ARGS]),
]);
isValid = true;
} catch {}
} catch {
// no-thing
}
if (!isValid) {
setIsTesting(false);