fix: rate-limit notification retries for non-existent windows#26
fix: rate-limit notification retries for non-existent windows#26
Conversation
When notification failed for a stateless agent (e.g., tmux window doesn't exist), the agent was not marked as notified. This caused mailman to retry every cycle, creating an infinite loop of failed notifications. Now notification failures also mark the agent as notified, rate-limiting retries to once per interval (60 seconds). The retry will stop entirely if the message gets read.
📝 WalkthroughWalkthroughWhen stateless agent notification fails, the code now marks the agent as notified via StatelessTracker to rate-limit retry attempts, preventing immediate retries. The successful notification path remains unchanged. This failure-handling branch complements existing behavior to avoid repeated notification attempts. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~15 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
📜 Recent review detailsConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (2)
🧰 Additional context used📓 Path-based instructions (2)**/*.go📄 CodeRabbit inference engine (CLAUDE.md)
Files:
**/*_test.go📄 CodeRabbit inference engine (CLAUDE.md)
Files:
🧬 Code graph analysis (1)internal/daemon/loop_test.go (1)
🔇 Additional comments (2)
✏️ Tip: You can disable this entire section by setting Comment |
Instead of letting notification fail for non-existent windows and then rate-limiting, check upfront if the tmux window exists. This provides cleaner logs (no "failed" errors for expected cases) and avoids unnecessary notification attempts. Added WindowCheckerFunc to make the check mockable in tests.
Summary
Test plan
TestStatelessNotification_WindowNotExiststo verify window check worksTestStatelessNotification_NotifyFailureto verify rate-limiting on other failuresgo test -race ./...