mirror of
https://github.com/YspCoder/clawgo.git
synced 2026-05-06 20:37:30 +08:00
fix(cron): ensure reminders keep delivery channel target
This commit is contained in:
@@ -387,9 +387,13 @@ func (al *AgentLoop) tryFallbackProviders(ctx context.Context, msg bus.InboundMe
|
||||
|
||||
func (al *AgentLoop) setSessionProvider(sessionKey, provider string) {
|
||||
key := strings.TrimSpace(sessionKey)
|
||||
if key == "" { return }
|
||||
if key == "" {
|
||||
return
|
||||
}
|
||||
provider = strings.TrimSpace(provider)
|
||||
if provider == "" { return }
|
||||
if provider == "" {
|
||||
return
|
||||
}
|
||||
al.providerMu.Lock()
|
||||
al.sessionProvider[key] = provider
|
||||
al.providerMu.Unlock()
|
||||
@@ -397,7 +401,9 @@ func (al *AgentLoop) setSessionProvider(sessionKey, provider string) {
|
||||
|
||||
func (al *AgentLoop) getSessionProvider(sessionKey string) string {
|
||||
key := strings.TrimSpace(sessionKey)
|
||||
if key == "" { return "" }
|
||||
if key == "" {
|
||||
return ""
|
||||
}
|
||||
al.providerMu.RLock()
|
||||
v := al.sessionProvider[key]
|
||||
al.providerMu.RUnlock()
|
||||
@@ -703,6 +709,11 @@ func (al *AgentLoop) processMessage(ctx context.Context, msg bus.InboundMessage)
|
||||
st.SetContext(msg.Channel, msg.ChatID)
|
||||
}
|
||||
}
|
||||
if tool, ok := al.tools.Get("remind"); ok {
|
||||
if rt, ok := tool.(*tools.RemindTool); ok {
|
||||
rt.SetContext(msg.Channel, msg.ChatID)
|
||||
}
|
||||
}
|
||||
|
||||
history := al.sessions.GetHistory(msg.SessionKey)
|
||||
summary := al.sessions.GetSummary(msg.SessionKey)
|
||||
|
||||
Reference in New Issue
Block a user