fix: 修复人参果agent主动消息循环+创建人参果1号

- renshenguo_ws_handler: 注入7条行为约束规则,禁止agent在无用户输入时主动发消息
- renshenguo2_ws_handler: 新增人参果1号 WS handler(行为约束版)
- renshenguo2_app_service: 新增人参果1号飞书消息服务
- config.py/main.py: 注册RENSHENGUO2配置和长连接启动

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
renjianbo
2026-05-06 21:13:44 +08:00
parent eabf90c496
commit fa13ffe479
5 changed files with 441 additions and 0 deletions

View File

@@ -255,6 +255,13 @@ async def startup_event():
except Exception as e:
logger.error(f"人参果长连接启动失败: {e}")
# 启动人参果1号飞书长连接(AI学习助手 — 行为约束版,禁止主动消息)
try:
from app.services.renshenguo2_ws_handler import start_ws_client as start_renshenguo2_ws
asyncio.ensure_future(start_renshenguo2_ws())
except Exception as e:
logger.error(f"人参果1号长连接启动失败: {e}")
# 注册路由
from app.api import auth, uploads, workflows, executions, websocket, execution_logs, data_sources, agents, platform_templates, model_configs, webhooks, template_market, batch_operations, collaboration, permissions, monitoring, alert_rules, node_test, node_templates, tools, agent_chat, agent_monitoring, knowledge_base, agent_schedules, notifications, feishu_bind, approval