Commit Graph
35 Commits
Author SHA1 Message Date
mohe 75026c9b7a feat: ocg_router空输出自动换key——_forward_request检测content为空→返回empty_content→_proxy_chat自动换下一个key重试(不冷却) 2026-08-14 09:31:07 +08:00
mohe 6a5c08a5df feat: ocg_router 并发模式——X-OCG-Mode: concurrent 时 round-robin 锁 key 轮询(每次请求轮着用key,避免并发压同一key触发429/401), 非并发模式保持按用量选最空闲; 测试验证key1→key4→key5→key6轮询 2026-08-14 04:06:26 +08:00
mohe c6d7d8b92d fix: 微信状态检测登录成功优先(logged in/Message), 消除历史日志干扰 2026-08-08 01:36:57 +08:00
mohe 6f9161cd93 fix: dashboard 微信状态检测识别等待扫码/会话失效, 不再误报已登录 2026-08-08 01:30:19 +08:00
mohe 8feed0092b fix: health_check 识别微信登录失效(loginCheck错误), 防止误报已登录 2026-08-08 01:03:13 +08:00
mohe be2b194b71 feat: WeChat QR code + status inline in Platform tab
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)
2026-08-02 04:43:16 +08:00
mohe b0ad75b88e fix: detect system_event_logout for real WeChat status
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
2026-08-02 04:32:37 +08:00
mohe 7581bccda5 fix: cross-platform config path in chat_bridge.py
_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.
2026-07-31 10:37:07 +08:00
mohe 406446c3f1 fix: WeChat session context via X-Hermes-Session-Id (revert SessionRouter)
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.
2026-07-31 10:11:53 +08:00
mohe 24be3b2aa5 feat: route WeChat messages through SessionRouter for per-user context
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
2026-07-31 03:43:19 +08:00
mohe fd6ea76f54 feat: WeChat status + QR on Dashboard, proactive login notifier
- /api/wechat/status: real login detection via webhook log + docker logs
- /api/platform: wechat_bridge now returns login_ok, message, qr_url
- Platform tab: inline QR code with 5min expiry + refresh button
- wechat_qr_notifier.py: 40h session-age WeChat warning + XMPP logout alert
- agents_health_check.py: login_check via docker logs
- wechat_webhook.py: timeout 180→600s
2026-07-31 03:22:35 +08:00
mohe 42a55f03c2 chore: 移除小果(agent-003)——已全线退役(dashboard默认agents/agents.yaml/auto_heal服务映射) 2026-07-21 22:46:42 +08:00
mohe 6da8bf219a docs: add modify-existing-feature flow with pre-read-spec step; update AGENTS.md, dev-spec.md 2026-07-17 13:29:56 +08:00
mohe 20389a40ac docs: kanban handler protocol v1 + merged API ref 2026-06-22 10:43:19 +08:00
mohe 90ed30dd36 kanban API: comment endpoint + usage docs, notification includes curl example 2026-06-21 11:29:17 +08:00
mohe aa7b67fc2b readonly: discard LLM response, never send; default=readonly for non-coordinator 2026-06-21 10:40:47 +08:00
mohe f1590e08d1 revert bare-name match, keep only @ mention 2026-06-20 20:21:21 +08:00
mohe 9a45f155a8 match nick without @ (XMPP strips @ symbol) 2026-06-20 20:18:47 +08:00
mohe be8699ae4c lead= switch, @mention auto-grant 2026-06-20 20:16:09 +08:00
mohe efc4cd1a9e coordinator prompt: first job is to moderate, not to speak 2026-06-20 19:57:03 +08:00
mohe ad3e0f004b coordinator: default all can speak, REVOKE=read-only 5min, GRANT overrides 2026-06-20 19:54:37 +08:00
mohe aabec04d8a non-speaking bots still see messages for context (read-only LLM injection) 2026-06-20 19:07:50 +08:00
mohe 90429116c7 coordinator: use XMPP in-band signaling instead of shared DB (cross-machine compatible) 2026-06-20 19:02:04 +08:00
mohe 457ad27044 implement coordinator pattern: GRANT-based turn control, code-level speak permission 2026-06-20 18:53:44 +08:00
mohe 947bb1e6d0 intercept __SILENT__/__REPLY__ misuse in LLM response body 2026-06-20 01:48:37 +08:00
mohe 5051b0bfd7 add silent phrase interception: block LLM announcing silence instead of being silent 2026-06-20 01:41:42 +08:00
mohe 50a0716c4d add dynamic session switch documentation 2026-06-20 01:21:03 +08:00
mohe 2d0f390657 unify xmpp bots: single xmpp_agent_core.py + --agent param wrappers 2026-06-20 01:05:12 +08:00
mohe 94c511479d docs: add '通道不限制行动力' principle to session bridge protocol 2026-06-14 03:08:09 +08:00
mohe ae16cd4e0f simplify: remove __REPLY__ marker, only __SILENT__ needed
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.
2026-06-14 02:00:33 +08:00
mohe 34e4477642 docs: clarify markers must be bare text, no backticks
Also updated xmpp_bot.py regex to handle backtick-wrapped markers defensively.
Updated MEMORY.md prompt to require bare markers.
2026-06-14 01:58:00 +08:00
mohe 8c2355d95f docs: refine session bridge search priority - own session first, then others 2026-06-14 01:54:42 +08:00
mohe ec335aff20 docs: add cross-session bridge protocol
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
2026-06-14 01:30:15 +08:00
mohe 90b729c292 docs: add observer mode protocol (__SILENT__/__REPLY__)
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
2026-06-14 00:42:05 +08:00
mohe 3a14d776c0 zhiwei bot: 添加MUC群聊支持(配置化房间列表 + 群消息收发 + 稳定重连)
改动内容:
- 从配置文件 zhiwei_rooms.txt 读取待加入群聊列表
- 注册 xep_0045 插件,on_bind 时自动加入所有配置房间
- on_msg 处理 groupchat 类型,只响应 hmo/xxm
- 群聊回复使用 xmpp.send_message(mtype='groupchat')
- 改为手动重连(auto_reconnect=False),指数退避
- 添加 xep_0199 keepalive(60s 间隔)防断线
- 私聊添加秒回确认 '收到,正在思考...'
- 超时从 600s 改为 120s
- __main__ 添加 PID 文件防多进程
2026-06-14 00:42:05 +08:00