From c9e482eb79c3359a18a9e48c1c2af94616c7386f Mon Sep 17 00:00:00 2001 From: wizardchen Date: Fri, 26 Dec 2025 21:46:46 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9EMCP=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E6=94=AF=E6=8C=81=EF=BC=8C=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E6=99=BA=E8=83=BD=E4=BD=93=E7=89=B9=E6=80=A7=E6=A0=87=E8=AF=86?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=EF=BC=9B=E8=B0=83=E6=95=B4=E5=86=85=E7=BD=AE?= =?UTF-8?q?=E6=99=BA=E8=83=BD=E4=BD=93=E6=8E=92=E5=BA=8F=E9=80=BB=E8=BE=91?= =?UTF-8?q?=EF=BC=8C=E7=A1=AE=E4=BF=9D=E6=99=BA=E8=83=BD=E4=BD=93=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=E4=B8=8B=E8=87=AA=E5=8A=A8=E5=90=AF=E7=94=A8=E5=A4=9A?= =?UTF-8?q?=E8=BD=AE=E5=AF=B9=E8=AF=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/i18n/locales/en-US.ts | 1 + frontend/src/i18n/locales/zh-CN.ts | 1 + frontend/src/views/agent/AgentList.vue | 27 ++++++++++++++++++++++---- internal/types/custom_agent.go | 18 +++++++++++------ 4 files changed, 37 insertions(+), 10 deletions(-) diff --git a/frontend/src/i18n/locales/en-US.ts b/frontend/src/i18n/locales/en-US.ts index a4b6b5c3..009423f1 100644 --- a/frontend/src/i18n/locales/en-US.ts +++ b/frontend/src/i18n/locales/en-US.ts @@ -241,6 +241,7 @@ export default { features: { webSearch: 'Web Search Enabled', knowledgeBase: 'Knowledge Base Linked', + mcp: 'MCP Services Enabled', multiTurn: 'Multi-turn Conversation', }, empty: { diff --git a/frontend/src/i18n/locales/zh-CN.ts b/frontend/src/i18n/locales/zh-CN.ts index 4ef52ba0..ffe75039 100644 --- a/frontend/src/i18n/locales/zh-CN.ts +++ b/frontend/src/i18n/locales/zh-CN.ts @@ -771,6 +771,7 @@ export default { features: { webSearch: "支持网络搜索", knowledgeBase: "关联知识库", + mcp: "支持MCP服务", multiTurn: "多轮对话", }, empty: { diff --git a/frontend/src/views/agent/AgentList.vue b/frontend/src/views/agent/AgentList.vue index f373d49c..13873937 100644 --- a/frontend/src/views/agent/AgentList.vue +++ b/frontend/src/views/agent/AgentList.vue @@ -95,17 +95,27 @@ - +
- + +
+
+ +
+
- +
@@ -658,6 +668,15 @@ defineExpose({ } } + &.mcp { + background: rgba(236, 72, 153, 0.08); + color: #ec4899; + + &:hover { + background: rgba(236, 72, 153, 0.12); + } + } + &.multi-turn { background: rgba(59, 130, 246, 0.08); color: #3b82f6; diff --git a/internal/types/custom_agent.go b/internal/types/custom_agent.go index 52ff6579..7953203f 100644 --- a/internal/types/custom_agent.go +++ b/internal/types/custom_agent.go @@ -195,6 +195,10 @@ func (a *CustomAgent) EnsureDefaults() { if a.Config.MaxCompletionTokens == 0 { a.Config.MaxCompletionTokens = 2048 } + // Agent mode should always enable multi-turn conversation + if a.Config.AgentMode == AgentModeSmartReasoning { + a.Config.MultiTurnEnabled = true + } } // IsAgentMode returns true if this agent uses ReAct agent mode @@ -281,13 +285,15 @@ var BuiltinAgentRegistry = map[string]func(uint64) *CustomAgent{ BuiltinSmartReasoningID: GetBuiltinSmartReasoningAgent, } -// GetBuiltinAgentIDs returns all built-in agent IDs +// builtinAgentIDsOrdered defines the fixed display order of built-in agents +var builtinAgentIDsOrdered = []string{ + BuiltinQuickAnswerID, + BuiltinSmartReasoningID, +} + +// GetBuiltinAgentIDs returns all built-in agent IDs in fixed order func GetBuiltinAgentIDs() []string { - ids := make([]string, 0, len(BuiltinAgentRegistry)) - for id := range BuiltinAgentRegistry { - ids = append(ids, id) - } - return ids + return builtinAgentIDsOrdered } // IsBuiltinAgentID checks if the given ID is a built-in agent ID