refactor: stabilize runtime and unify config

This commit is contained in:
lpf
2026-03-14 21:40:12 +08:00
parent 60eee65fec
commit 341e578c9f
75 changed files with 3081 additions and 1627 deletions

View File

@@ -3,6 +3,7 @@ package tools
import (
"context"
"fmt"
"strings"
"sync"
"time"
@@ -65,18 +66,18 @@ func (t *RemindTool) Execute(ctx context.Context, args map[string]interface{}) (
return "", fmt.Errorf("cron service not available")
}
message, ok := args["message"].(string)
if !ok {
message := MapRawStringArg(args, "message")
if strings.TrimSpace(message) == "" {
return "", fmt.Errorf("message is required")
}
timeExpr, ok := args["time_expr"].(string)
if !ok {
timeExpr := MapStringArg(args, "time_expr")
if timeExpr == "" {
return "", fmt.Errorf("time_expr is required")
}
channel, _ := args["channel"].(string)
chatID, _ := args["chat_id"].(string)
channel := MapStringArg(args, "channel")
chatID := MapStringArg(args, "chat_id")
if channel == "" || chatID == "" {
t.mu.RLock()
defaultChannel := t.defaultChannel