Bug Description
The SDK observation generator consistently returns non-XML idle responses on every session exit, causing the session to be poisoned and no observations to be stored. This happens regardless of model selection (Haiku or Sonnet) and persists across multiple reinstalls.
Steps to Reproduce
Install claude-mem on Ubuntu with Claude Pro subscription auth
Open Claude Code in any project
Do any work (read files, run commands, ask questions)
Exit the session cleanly with exit
Observe the worker console — Stop hook fires, SDK session starts, returns idle 3 times, session poisoned
Expected Behavior
The background SDK observation generator should contact the configured model, receive a valid XML block in response, and store it to the SQLite database with STORED | obsCount > 0.
Environment
Claude-mem version: 13.8.0
Claude Code version: Latest (OAuth subscription auth via claude.ai)
OS: Ubuntu 24 (Linux)
Platform: x86_64, Python 3.14, Bun 1.3.14, uv 0.11.24
Auth method: Claude Pro subscription (CLAUDE_MEM_CLAUDE_AUTH_METHOD=subscription)
Model tested: claude-haiku-4-5-20251001 (default), claude-sonnet-4-6 (manual override)
Logs
[2026-06-24 16:29:37.138] [INFO ] [WORKER] Broadcasting processing status {isProcessing=true, queueDepth=1, activeSessions=1}
[2026-06-24 16:29:38.128] [WARN ] [PARSER] [session-6] SDK returned non-XML idle response — ignoring queued batch {outputClass=idle, preview=, consecutiveInvalidOutputs=1}
[2026-06-24 16:29:41.347] [WARN ] [PARSER] [session-6] SDK returned non-XML idle response — ignoring queued batch {outputClass=idle, preview=, consecutiveInvalidOutputs=2}
[2026-06-24 16:29:48.162] [WARN ] [PARSER] [session-6] SDK returned non-XML idle response — ignoring queued batch {outputClass=idle, preview=, consecutiveInvalidOutputs=3}
[2026-06-24 16:29:48.163] [ERROR] [SESSION] [session-6] SDK session poisoned — killing and respawning, pending messages preserved {outputClass=idle, consecutiveInvalidOutputs=3, threshold=3}
[2026-06-24 16:29:48.163] [WARN ] [SESSION] [session-6] Respawning poisoned SDK session, preserving pending messages {preservedPending=1, consecutiveInvalidOutputs=3}
[2026-06-24 16:29:50.582] [INFO ] [SESSION] [session-6] Generator exited — finalizing session {reason=poisoned}
[2026-06-24 16:29:50.587] [INFO ] [SESSION] [session-6] Session finalized
[2026-06-24 16:29:50.588] [INFO ] [SESSION] [session-6] Session removed from active sessions {project=Prompt-Creator}
Additional Context
Diagnostics confirmed before filing:
npx claude-mem doctor passes all 5 checks (Bun, uv, plugin, deps, worker daemon)
claude auth status confirms valid Pro subscription OAuth token
~/.claude-mem/settings.json is valid JSON (confirmed via npx claude-mem status with no parse errors)
Timing analysis: early attempts showed 231ms to poisoning (suggesting pre-model failure); after model change to Sonnet and settings fix, gap increased to 4-6 seconds (confirming model is being contacted but returning idle)
Python 3.14 incompatibility prevents chromadb 0.5.23 downgrade (tokenizers Rust/PyO3 build fails); running on chromadb 1.5.9 with Chroma disabled as workaround
Prompt-level capture works correctly — npx claude-mem search returns session prompts with timestamps
Only the AI observation compression layer (Stop hook → SDK generator → XML → SQLite) is broken
Issue matches pattern in #696 (SDK returning prose/idle instead of XML) but persists despite model upgrade
Bug Description
The SDK observation generator consistently returns non-XML idle responses on every session exit, causing the session to be poisoned and no observations to be stored. This happens regardless of model selection (Haiku or Sonnet) and persists across multiple reinstalls.
Steps to Reproduce
Install claude-mem on Ubuntu with Claude Pro subscription auth
Open Claude Code in any project
Do any work (read files, run commands, ask questions)
Exit the session cleanly with exit
Observe the worker console — Stop hook fires, SDK session starts, returns idle 3 times, session poisoned
Expected Behavior
The background SDK observation generator should contact the configured model, receive a valid XML block in response, and store it to the SQLite database with STORED | obsCount > 0.
Environment
Claude-mem version: 13.8.0
Claude Code version: Latest (OAuth subscription auth via claude.ai)
OS: Ubuntu 24 (Linux)
Platform: x86_64, Python 3.14, Bun 1.3.14, uv 0.11.24
Auth method: Claude Pro subscription (CLAUDE_MEM_CLAUDE_AUTH_METHOD=subscription)
Model tested: claude-haiku-4-5-20251001 (default), claude-sonnet-4-6 (manual override)
Logs
[2026-06-24 16:29:37.138] [INFO ] [WORKER] Broadcasting processing status {isProcessing=true, queueDepth=1, activeSessions=1}
[2026-06-24 16:29:38.128] [WARN ] [PARSER] [session-6] SDK returned non-XML idle response — ignoring queued batch {outputClass=idle, preview=, consecutiveInvalidOutputs=1}
[2026-06-24 16:29:41.347] [WARN ] [PARSER] [session-6] SDK returned non-XML idle response — ignoring queued batch {outputClass=idle, preview=, consecutiveInvalidOutputs=2}
[2026-06-24 16:29:48.162] [WARN ] [PARSER] [session-6] SDK returned non-XML idle response — ignoring queued batch {outputClass=idle, preview=, consecutiveInvalidOutputs=3}
[2026-06-24 16:29:48.163] [ERROR] [SESSION] [session-6] SDK session poisoned — killing and respawning, pending messages preserved {outputClass=idle, consecutiveInvalidOutputs=3, threshold=3}
[2026-06-24 16:29:48.163] [WARN ] [SESSION] [session-6] Respawning poisoned SDK session, preserving pending messages {preservedPending=1, consecutiveInvalidOutputs=3}
[2026-06-24 16:29:50.582] [INFO ] [SESSION] [session-6] Generator exited — finalizing session {reason=poisoned}
[2026-06-24 16:29:50.587] [INFO ] [SESSION] [session-6] Session finalized
[2026-06-24 16:29:50.588] [INFO ] [SESSION] [session-6] Session removed from active sessions {project=Prompt-Creator}
Additional Context
Diagnostics confirmed before filing:
npx claude-mem doctor passes all 5 checks (Bun, uv, plugin, deps, worker daemon)
claude auth status confirms valid Pro subscription OAuth token
~/.claude-mem/settings.json is valid JSON (confirmed via npx claude-mem status with no parse errors)
Timing analysis: early attempts showed 231ms to poisoning (suggesting pre-model failure); after model change to Sonnet and settings fix, gap increased to 4-6 seconds (confirming model is being contacted but returning idle)
Python 3.14 incompatibility prevents chromadb 0.5.23 downgrade (tokenizers Rust/PyO3 build fails); running on chromadb 1.5.9 with Chroma disabled as workaround
Prompt-level capture works correctly — npx claude-mem search returns session prompts with timestamps
Only the AI observation compression layer (Stop hook → SDK generator → XML → SQLite) is broken
Issue matches pattern in #696 (SDK returning prose/idle instead of XML) but persists despite model upgrade