fix(mem0-plugin): review fixes — loop guard, v3 response format, robustness

- on_stop_cursor.sh: add loop_count guard to prevent infinite re-entry
- on_stop.sh: drop set -e so stats failure doesn't kill the reminder
- _identity.py: fix fallback stub signatures to match production (accept cwd arg)
- on_pre_compact.py: add missing infer=False on session_state writes
- on_session_start.sh: handle v3 search response format (dict with results key)
- Align all plugin versions to 0.2.1 (Claude Code, Codex, Cursor)
This commit is contained in:
kartik-mem0
2026-05-21 18:27:47 +05:30
parent 470cef6ba6
commit 4b94902446
7 changed files with 24 additions and 11 deletions
+8 -5
View File
@@ -53,12 +53,15 @@ req = urllib.request.Request(
)
try:
with urllib.request.urlopen(req, timeout=5) as r:
results = json.loads(r.read())
if isinstance(results, list):
n = len(results)
print(f'{n}+' if n >= 100 else str(n))
data = json.loads(r.read())
if isinstance(data, list):
results = data
elif isinstance(data, dict) and 'results' in data:
results = data['results']
else:
print('?')
print('?'); raise SystemExit
n = len(results)
print(f'{n}+' if n >= 100 else str(n))
except Exception:
print('?')
" 2>/dev/null || echo "?")