From 7e0268a884327207e3cfc57b1404bbef2c828912 Mon Sep 17 00:00:00 2001 From: AskaEth Date: Tue, 23 Jun 2026 21:27:02 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20reminder=20platform=20=E6=94=B9=E7=94=A8?= =?UTF-8?q?=20AdapterName=EF=BC=88=E5=94=AF=E4=B8=80=E6=A0=87=E8=AF=86?= =?UTF-8?q?=E7=AC=A6=EF=BC=89=EF=BC=8C=E4=B8=8D=E5=86=8D=E7=A1=AC=E7=BC=96?= =?UTF-8?q?=E7=A0=81=20obv11?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ProcessParams/SynthesizeParams 新增 AdapterName - main.go 传递 req.Source.AdapterName - reminder_create 自动注入使用 adapter 名而非平台类型 Co-Authored-By: Claude --- backend/ai-core/cmd/main.go | 1 + backend/ai-core/internal/orchestrator/orchestrator.go | 2 ++ backend/ai-core/internal/orchestrator/synthesizer.go | 3 ++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/ai-core/cmd/main.go b/backend/ai-core/cmd/main.go index f89a75b..65587de 100644 --- a/backend/ai-core/cmd/main.go +++ b/backend/ai-core/cmd/main.go @@ -1086,6 +1086,7 @@ func handleChat( ChannelType: req.Source.ChannelType, ChannelID: req.Source.ChannelID, BotUID: req.Source.BotUID, + AdapterName: req.Source.AdapterName, }) if err != nil { fallback := getFallbackMessage() diff --git a/backend/ai-core/internal/orchestrator/orchestrator.go b/backend/ai-core/internal/orchestrator/orchestrator.go index 212e704..7da2c88 100644 --- a/backend/ai-core/internal/orchestrator/orchestrator.go +++ b/backend/ai-core/internal/orchestrator/orchestrator.go @@ -154,6 +154,7 @@ type ProcessParams struct { ChannelType string // direct / group ChannelID string // platform channel ID (group ID or private OBv11 number) BotUID string // bot's own platform UID (e.g., OBv11 account) + AdapterName string // adapter config name for routing } // ProcessResult 处理结果 @@ -430,6 +431,7 @@ func (o *Orchestrator) ProcessInput( Mode: params.Mode, ChannelType: params.ChannelType, ChannelID: params.ChannelID, + AdapterName: params.AdapterName, } if prevEnrichment != nil { synthParams.MemorySummary = prevEnrichment.MemorySummary diff --git a/backend/ai-core/internal/orchestrator/synthesizer.go b/backend/ai-core/internal/orchestrator/synthesizer.go index f5d6000..4ef0e9f 100644 --- a/backend/ai-core/internal/orchestrator/synthesizer.go +++ b/backend/ai-core/internal/orchestrator/synthesizer.go @@ -54,6 +54,7 @@ type SynthesizeParams struct { Mode string // text / voice_assistant ChannelType string // direct / group ChannelID string // platform channel ID + AdapterName string // adapter config name } // Synthesize 综合所有子会话结果,流式生成最终回复。 @@ -97,7 +98,7 @@ func (s *Synthesizer) Synthesize(ctx context.Context, params SynthesizeParams, e // 自动注入当前会话的平台信息(reminder_create 需要知道来源) if tc.Name == "reminder_create" && params.ChannelType != "" { if _, ok := args["platform"]; !ok || args["platform"] == "" { - args["platform"] = "obv11" + args["platform"] = params.AdapterName } if _, ok := args["channel_type"]; !ok || args["channel_type"] == "" { args["channel_type"] = params.ChannelType