SessionRouter approach failed on Linux because chat_bridge.py has
hardcoded Windows paths for provider config and opencode.db.
Instead, use the same pattern as xmpp_agent_core.py: direct Hermes API
call with X-Hermes-Session-Id=wechat-{sender_id} for per-user sessions.
This gives each WeChat user persistent context in Hermes without
depending on cross-platform path issues in chat_bridge.py.
Previously wechat_webhook.py sent each WeChat message as a stateless
API call to Hermes (no X-Hermes-Session-Id), so Mohe had zero memory
of previous messages. Now uses SessionRouter with SessionBridge
(same as XMPP path), which:
- Maintains per-user sessions via opencode.db
- Injects recent conversation context automatically
- Uses the same model/LLM pipeline as XMPP messages
Root cause: user-level hermes-gateway.service was running the same
-p default gateway as the system-level hermes-gateway@default.service,
causing the two to SIGTERM each other every ~5 minutes. This killed
in-flight Hermes API requests with 'Remote end closed connection'.
Fix: disabled the redundant user-level service.
Also: simplified webhook to just forward raw message content (no
system prompt, no ACK, no max_tokens overrides). Removed unused
_get_ack method.
- Moved old GDB hook and memory monitor scripts to archive/
- Updated README with final Docker solution
- Updated .env.example, .gitignore
- Added final-note.md documenting deployment decision
- All research scripts preserved in archive/ for reference