fix: SynthesizeParams 加 ChannelID
This commit is contained in:
@@ -429,6 +429,7 @@ func (o *Orchestrator) ProcessInput(
|
||||
DialogHistory: history,
|
||||
Mode: params.Mode,
|
||||
ChannelType: params.ChannelType,
|
||||
ChannelID: params.ChannelID,
|
||||
}
|
||||
if prevEnrichment != nil {
|
||||
synthParams.MemorySummary = prevEnrichment.MemorySummary
|
||||
|
||||
@@ -53,6 +53,7 @@ type SynthesizeParams struct {
|
||||
PendingToolResults []PendingToolResult // 上一轮异步完成的工具结果
|
||||
Mode string // text / voice_assistant
|
||||
ChannelType string // direct / group
|
||||
ChannelID string // platform channel ID
|
||||
}
|
||||
|
||||
// Synthesize 综合所有子会话结果,流式生成最终回复。
|
||||
@@ -93,6 +94,25 @@ func (s *Synthesizer) Synthesize(ctx context.Context, params SynthesizeParams, e
|
||||
args = make(map[string]interface{})
|
||||
}
|
||||
|
||||
// 自动注入当前会话的平台信息(reminder_create 需要知道来源)
|
||||
if tc.Name == "reminder_create" && params.ChannelType != "" {
|
||||
if _, ok := args["platform"]; !ok || args["platform"] == "" {
|
||||
args["platform"] = "obv11"
|
||||
}
|
||||
if _, ok := args["channel_type"]; !ok || args["channel_type"] == "" {
|
||||
args["channel_type"] = params.ChannelType
|
||||
}
|
||||
if _, ok := args["channel_id"]; !ok || args["channel_id"] == "" {
|
||||
// Strip platform-internal prefix (private_xxx -> xxx)
|
||||
chID := params.ChannelID
|
||||
if strings.HasPrefix(chID, "private_") {
|
||||
chID = chID[len("private_"):]
|
||||
}
|
||||
args["channel_id"] = chID
|
||||
}
|
||||
// adapter_name will be resolved when the reminder fires
|
||||
}
|
||||
|
||||
s.emitToolProgress(eventCh, tc.Name, "started", 0, "正在执行 "+tc.Name)
|
||||
s.emitToolProgress(eventCh, tc.Name, "started", 0, "正在执行 "+tc.Name)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user