feat: update auto reply and packaging

This commit is contained in:
ly1213
2026-06-29 17:44:22 +08:00
parent 1ca66dc0af
commit 2d5ee7f08d
19 changed files with 1147 additions and 227 deletions

View File

@@ -121,6 +121,7 @@ type AutoReplyEngine struct {
humanPending map[string]*humanAssistPending
collaborations map[string]*collaborationSession
autoSent map[string]time.Time
materialSent map[string]time.Time
records []AutoReplyRecord
nextRecordID int64
status AutoReplyStatus
@@ -177,6 +178,7 @@ func initAutoReplyEngine() {
humanPending: make(map[string]*humanAssistPending),
collaborations: make(map[string]*collaborationSession),
autoSent: make(map[string]time.Time),
materialSent: make(map[string]time.Time),
status: AutoReplyStatus{
Enabled: cfg.Enabled,
Running: cfg.Enabled,
@@ -318,6 +320,19 @@ func (e *AutoReplyEngine) setLastErrorWithScope(scope string, msg string) {
}
}
func (e *AutoReplyEngine) clearLastErrorScope(scope string) {
scope = normalizeAutoReplyErrorScope(scope)
if scope == "" {
return
}
e.mu.Lock()
if e.status.LastErrorScope == scope {
e.status.LastError = ""
e.status.LastErrorScope = ""
}
e.mu.Unlock()
}
func normalizeAutoReplyErrorScope(scope string) string {
switch strings.TrimSpace(scope) {
case autoReplyErrorScopeListen: