diff --git a/backend/ai-core/internal/background/thinker.go b/backend/ai-core/internal/background/thinker.go index c8ed50f..2a2ca3c 100644 --- a/backend/ai-core/internal/background/thinker.go +++ b/backend/ai-core/internal/background/thinker.go @@ -2661,6 +2661,10 @@ func (t *Thinker) muLock() { // muUnlock releases t.mu and clears the tracking. func (t *Thinker) muUnlock() { + held := time.Since(t.muLockedAt) + if held > 5*time.Second { + log.Printf("[debug] muUnlock: lock held for %v by %s", held.Round(time.Millisecond), t.muLockedBy) + } t.muLockedBy = "" t.mu.Unlock() }