fix(mem0-agent): non-blocking stdin, clean session_state, lint

Found by running the CLI live against a scratch project:
- hook_input() blocked forever on an open stdin pipe with no data. A real hook
  writes JSON and closes the pipe, but any manual invocation hung; now polled
  with select() and never blocks.
- the open-thread snapshot was filling with progress lines and file-modification
  lists -- v1's exact failure -- so it now filters turns through the same
  hard-drop rules the capture gate uses.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Deshraj Yadav
2026-07-28 02:12:23 -07:00
co-authored by Claude Fable 5
parent 4d5f2e653c
commit ba1de5f87b
6 changed files with 76 additions and 9 deletions
@@ -1,6 +1,5 @@
"""Consolidation must never lose data, and must never touch a pinned memory."""
import pytest
from mem0_agent import maintain
from mem0_agent.maintain import jaccard, tokens