feat: store mcp_config when switch agent strategy (#19291)

This commit is contained in:
Good Wood 2025-05-07 14:49:28 +08:00 committed by GitHub
parent c457e2b67a
commit d1c08a810b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -102,7 +102,6 @@ const AgentPanel: FC<NodePanelProps<AgentNodeType>> = (props) => {
agent_strategy_label: strategy?.agent_strategy_label,
output_schema: strategy!.agent_output_schema,
plugin_unique_identifier: strategy!.plugin_unique_identifier,
agent_parameters: {},
})
resetEditor(Date.now())
}}

View File

@ -85,12 +85,13 @@ const useConfig = (id: string, payload: AgentNodeType) => {
enabled: Boolean(pluginId),
})
const formData = useMemo(() => {
const paramNameList = (currentStrategy?.parameters || []).map(item => item.name)
return Object.fromEntries(
Object.entries(inputs.agent_parameters || {}).map(([key, value]) => {
Object.entries(inputs.agent_parameters || {}).filter(([name]) => paramNameList.includes(name)).map(([key, value]) => {
return [key, value.value]
}),
)
}, [inputs.agent_parameters])
}, [inputs.agent_parameters, currentStrategy?.parameters])
const onFormChange = (value: Record<string, any>) => {
const res: ToolVarInputs = {}
Object.entries(value).forEach(([key, val]) => {