BUG: Watcher fails to follow session rotation on /new or /reset #4
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
The realtime_qdrant_watcher v1.1 fails to detect new sessions when users invoke
/newor/reset, causing conversation turns to be missed and not stored to Qdrant.Problem Details
Root Cause Analysis
The watcher v1.1 used
st_mtime(file modification time) polling every 1 second to detect new sessions. When/newor/resetis used in OpenClaw:max(files, key=lambda p: p.stat().st_mtime)returns the OLD file (newer mtime)Evidence from Production
Session Timeline:
a0c59a27started at 13:45/newat 18:58 → New session9b78d0accreatedDebug Output:
Why v1.1 Failed
Failed because:
Impact
Severity: HIGH
Steps to Reproduce
/newor/resetAffected Versions
Solution (v1.2)
Design Goals
/newor/resetImplementation
1. Enhanced File Scoring (
file_score)Why it works:
2. Inactivity Detection
Why it works:
3. Activity Tracking
Why it works:
4. Session Switching Logic
Why it works:
watch_sessionsignals switch by returning different fileValidation
Test Results
Verification Steps
pgrep -fa realtime_qdrant_watcherlsof -p 99395 | grep jsonlhead -10shows v1.2 header/newcorrectlyGit References
5c2014c Fix: Proper session rotation detection (v1.2)v1.2.0watcher/realtime_qdrant_watcher.pyskills/qdrant-memory/scripts/realtime_qdrant_watcher.pyResolution
Status: ✅ FIXED in v1.2.0
The session rotation bug has been resolved. The watcher now correctly follows
/newand/resetcommands, ensuring no conversation data is lost.Fixed in v1.2.0
The session rotation bug has been resolved:
/newand/resetClosing as resolved.