wechat_bridge entry now shows:
- status text (已登录Xh / 已掉线Xh) via s.message
- inline QR code with 5min expiry + refresh button when logged out
- refreshWechatQR() fetches latest QR on demand (no polling)
Previously only looked for WeChat send OK/error in last 200 log lines.
system_event_logout was missed, so dashboard showed 正常 when session
was actually dead. Now:
- Greps full webhook log for system_event_login/logout
- Logout after login => logged_out status
- WeChat send timeout (Hermes error) also counts as failure
_load_providers and _SERVE_DB had hardcoded C:\\\\Users\\\\hmo paths.
Now uses os.path.expanduser(" ~\) as primary path, with Windows
fallback. Supports OPENCODE_CONFIG_PATH env override.
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
Default LLM behavior is to reply - no prefix needed.
Only the exceptional case (silence) needs a marker.
Updated xmpp_bot.py, MEMORY.md, and protocol doc.
Define how agents should handle messages referencing context
from other sessions (CLI/XMPP/WeChat channel switching).
- SOUL.md: new section 五 on session bridging
- agentmemory: saved as shared architecture rule
- SESSION-BRIDGE-PROTOCOL.md: full protocol doc
Define code+LLM collaboration protocol for group chat participation:
- Code layer: no @mention gate, forward all msgs to LLM
- LLM layer: output __SILENT__ (discard) or __REPLY__ (send)
- Documented in MEMORY.md (LLM prompt) and AgentsMeeting (shared ref)
- Update xmpp_bot.py to remove @mention gate