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
Old xmpp_bot.py (PID-locked separately) coexisted with new xmpp_agent_core,
causing duplicate JID connections and split bridge traffic (5802 vs 5807).
Deploy scripts now use new bot's :5807 bridge with X-Api-Key auth.
Yesterday's malformed packet (TPKT len=0x1b mismatch) made health check
always fail -> every enable triggered needless TermService restarts and
false 'STILL FAILING' reports (root cause of 2026-07-23 morning incident)
- _rdp_find_tunnel_process(): find ssh.exe hosting -R 8080 forwarding via CIM
- _rdp_status(): adopt actual tunnel process when pid file stale/missing
- _rdp_enable(): adopt existing tunnel instead of spawning duplicate that
fails on 'remote port forwarding failed' (8080 occupied)
- Fixes 2026-07-23 incident: tunnel alive but dashboard showed disabled,
repeated enable attempts failed because port was occupied by working tunnel
- ocg_collect.sh: local OCG collection via HTTP+cookies
- kimi_collect_local.sh: local Kimi collection via Playwright CDP
- Replaces kimi_collect.sh (SSH-to-Windows approach)
- usage_collector_kimi_local.py: Playwright connect_over_cdp to local Chrome
- kimi_login.py: interactive login helper for headless Chrome
- Replaces SSH-to-Windows approach, removes single point of failure
- Chrome CDP service: chrome-kimi-cdp.service (systemd)