The realtime_qdrant_watcher v1.1 fails to detect new sessions when users invoke /new or /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 /new or /reset is used in OpenClaw:
New session file created with old timestamp (file creation time)
Old session still has recent mtime from last write operation
max(files, key=lambda p: p.stat().st_mtime) returns the OLD file (newer mtime)
Watcher stays stuck on old session indefinitely
All new conversation in new session is silently lost
Evidence from Production
Session Timeline:
Session a0c59a27 started at 13:45
User ran /new at 18:58 → New session 9b78d0ac created
Watcher PID 94384 still watching old session at 19:03
defwatch_loop(dry_run:bool=False):whilerunning:session_file=get_current_session_file()ifcurrent_file!=session_file:print(f"New session: {session_file.name}")current_file=session_fileturn_counter=0result=watch_session(session_file,dry_run)ifresultandresult!=session_file:print(f"Switching to: {result.name}")current_file=resultlast_position=0
Why it works:
watch_session signals switch by returning different file
Clean transition with reset counters
Validation
Test Results
Check
Before v1.2
After v1.2
Watcher PID
94384 (stuck)
99395 (active)
Watching
a0c59a27 (old)
29f3a557 (current)
Session lines
2 (stale)
64 (growing)
Qdrant count
14,620
14,653 (+33)
Verification Steps
✅ Process running: pgrep -fa realtime_qdrant_watcher
✅ Correct file: lsof -p 99395 | grep jsonl
✅ Code deployed: head -10 shows v1.2 header
✅ Data flowing: Qdrant count increasing
✅ New session test: Watcher followed /new correctly
**Fixed in v1.2.0**
The session rotation bug has been resolved:
- Watcher now correctly follows `/new` and `/reset`
- Tested: 64 lines captured in current session
- Qdrant: 14,653 points (+12 new)
Closing as resolved.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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.