Commit Graph
273 Commits
Author SHA1 Message Date
qihu-bot e284d43cc7 #970 微信Bot P1增强 - sendtyping + 语音ASR + Session Guard
CI / gate (push) Has been cancelled
1.语音消息ASR: 提取voice_item.text(微信自带转文字) 2.sendtyping正在输入状态: getconfig拿typing_ticket缓存24h + sendtyping发送 3.Session Guard增强: 会话过期记录告警日志供前台提示重扫
2026-08-15 18:13:47 +08:00
qihu-bot 46e9f1e1e6 #969 微信Bot媒体内联发送 - iLink CDN AES加密上传
CI / gate (push) Has been cancelled
参考微信官方openclaw-weixin源码实现媒体内联发送链路:下载媒体→getuploadurl→AES-128-ECB加密→上传微信CDN→内联发送(type=2/5)。新增im_ilink_media.py模块。失败降级文本链接兜底。修复pg18/casdoor容器未启动问题。
2026-08-15 17:45:47 +08:00
qihu-bot 894eeff65a docs: 微信Bot iLink协议重构方案 v1.0
CI / gate (push) Has been cancelled
分析微信官方iLink(ClawBot)协议完整能力,对比平台现状,识别5项差距。核心:媒体内联发送(CDN AES-128-ECB加密)替代文本链接降级。分5阶段实施(P0-P2)。
2026-08-15 17:14:07 +08:00
qihu-bot d2d133f22a docs: 全面更新 README.md + ARCHITECTURE.md v3.0
CI / gate (push) Has been cancelled
ARCHITECTURE.md v3.0: 护城河分析,容器拓扑,技术栈矩阵,功能架构,双Claw单引擎,模型同步,安全纵深,qihu-design-system,迭代路线. README.md v3.0: 快速开始,核心能力,架构总览,项目结构,开发指南,平台数据.
2026-08-12 09:20:55 +08:00
qihu-bot 54b444b651 #967 implement media_relay endpoint - fix WeChat bot image relay
media_relay was a stub (empty function body). Now implements actual image/video streaming relay from S3 to WeChat clients, with domain whitelist and httpx streaming. Fixes WeChat bot image generation responses not rendered.
2026-08-11 21:31:15 +08:00
qihu-bot 75be24ce9c #966 fix - litellm_sync import + IndentationError
## Root cause: ImportError sync_health_check not defined. ## Also IndentationError on L467/L590 in nested sync blocks. ## Container stable, public URL 200 OK.
2026-08-11 21:12:56 +08:00
qihu-bot fd84fec5b1 #965 LiteLLM model sync - STORE_MODEL_IN_DB + API integration
docker-compose.yml +STORE_MODEL_IN_DB=True enables LiteLLM dynamic model management via REST API. models.py admin CRUD now syncs to LiteLLM via threading.
2026-08-11 15:27:57 +08:00
qihu-bot fa38d2c57a #964 修复 React error #321 模块级 useState 调用
Models.tsx L31 const [lockedCapDefaults, setLockedCapDefaults] = useState(...) 在模块顶层,违反 React Hooks 规则. 移到 Models component 函数体内 (L56). 解决 production 报 React error #321 Invalid hook call.
2026-08-11 13:57:51 +08:00
qihu-bot 679f23ff93 #963 safeLazy 包裹 React.lazy 防 chunk 加载失败导致 element undefined
App.tsx 所有 React.lazy 改为 safeLazy(loader).catch(...) 保证 chunk load 失败时 element 有 fallback 不会是 undefined. 防 React error #231.
2026-08-11 13:06:42 +08:00
qihu-bot 420e0f6603 #962 全局 ErrorBoundary 隔离组件渲染错误
main.tsx 加 ErrorBoundary 包裹 App,任何组件抛错都会显示在页面上而不是让 root 空白. 基于 #961 诊断:React 18 mount 正常,问题在 App.tsx 组件树.
2026-08-11 12:53:04 +08:00
qihu-bot 4cf910ee3e #961 /admin/models React #425 hydration mismatch 修复
main.tsx 加全局错误处理 + #root 清空 + try-catch 包裹 createRoot. 解决 React 18.3.1 在空 #root 容器中误触发 hydration 警告导致 mount 失败.
2026-08-11 12:43:40 +08:00
qihu-bot 45b6939ab3 #959 /admin/models 空白页修复 - nginx index.html 加 no-store 头
nginx index.html 加 Cache-Control: no-store + Pragma: no-cache + Expires: 0,强制浏览器每次拉新版 SPA. 修复 #957 修复后浏览器仍缓存旧 615 bytes nginx welcome 导致的空白页.
2026-08-11 09:31:50 +08:00
qihu-bot 53bbbf3195 #957 nginx 容器 root 修复 - ai.qihuyun.com 显示 nginx 默认页
aiflow.conf 缺 server 级 root 指令导致 SPA fallback 走 nginx 默认 /usr/share/nginx/html. 修复后容器 8080 / host 12888 / 外部 ai.qihuyun.com 全部正确返回 544 bytes 七虎AI 前端页.
2026-08-11 08:55:49 +08:00
QihuAI Design e58c37ea17 #954 更新扫描器 UA 黑名单加入 Infrawatch + InternetMeasurement (20260810-205514)
access.log 发现 Infrawatch 探测 /mcp /sse 端点,InternetMeasurement 探测 / 首页. 加入 UA 黑名单 return 444. 验证:两个 UA 均被 444,正常 Mozilla 浏览器 200.
2026-08-10 20:55:15 +08:00
qihu-bot b415a0b62e #937 LiteLLM 副 key 启用脚本 + 计划 (20260810-154721)
新增 litellm/apply_secondary_key.sh + rollback + verify + README + docs/observability/litellm-failover-activation.md. 代码层已就绪(commit 84d89ab),等用户提供 SiliconFlow 副 key 后,单次低峰会话完成切换.
2026-08-10 15:47:21 +08:00
qihu-bot e50d006ef4 #952 alloy traces 配置 bake Dockerfile + 计划 (20260810-154537)
新增 alloy/Dockerfile + config.alloy + build.sh + README + docs/observability/alloy-bake-plan.md. 当前 bind mount /tmp/alloy 仍稳定,本会话仅交付可执行件,实际 build 待低峰期执行.
2026-08-10 15:45:37 +08:00
qihu-bot 7e002ac2b5 P1-1 后端核心模块单测 (20260810-154318)
新增 test_capability_discovery.py (30) + test_llm_router.py (21) 共 51 个哨兵单测,覆盖 #874 双 Claw 能力发现 / #875 LLM 路由熔断 / #876 OTel 桥接关键路径. 套件: 116 -> 165 passed.
2026-08-10 15:43:19 +08:00
qihu-bot cee260d4bd P1-2 nginx 限流 + 扫描器拦截 (20260810-153624)
三档限流 (api 30r/s, admin 5r/s, login 1r/s) + UA / path 黑名单 (return 444) + 自动黑名单脚本 (5min cron, 24h TTL). 实测首跑封禁 222.128.55.233 (4xx=31) 和 120.55.61.72 (UA=zgrab).
2026-08-10 15:36:25 +08:00
SeniorDev bc96a087dd P0-1+P2-1+P2-3: 修 OTel traces pipeline + DROP LangBot 表 + nginx logrotate + cron 2026-08-10 14:31:44 +08:00
SeniorDev 56eb9f1634 #939 应用市场产品计费 webhook 设计 (HMAC 验签 + 幂等去重 + reconcile worker) 2026-08-09 21:42:27 +08:00
SeniorDev 0820d408eb #938 ChatPage UX 打磨 (移动端响应式 + 暗态增强 + 代码块复制按钮) 2026-08-09 21:40:44 +08:00
SeniorDev 84d89ab95a #937 LiteLLM failover 沙箱设计 + 演练脚本 2026-08-09 21:37:39 +08:00
SeniorDev 6e89a37ff7 #936 MCP SDK streamablehttp 稳定性回归 (兼容 mcp 2.0 重命名 + httpx2 fork) 2026-08-09 21:33:28 +08:00
SeniorDev 6d5c2cf2c0 #935 IM Bot Channel Adapter 化 (Telegram POC + im_channel_routes schema) 2026-08-09 21:06:01 +08:00
SeniorDev 048671870a stage3: 技能/应用市场解耦 - 前端拆分 (/marketplace/products + /admin/market-products) 2026-08-09 06:59:29 +08:00
QihuAI Design c1f8b164bb docs+tests: #873 事件契约与双 Claw Adapter 文档及哨兵测试
- 新增 tests/test_engine_event.py (31 用例: EngineEvent 线格式/to_wire/from_wire,
  SseAdapter 裁剪+帧格式+frames, BufferAdapter 累积/媒体/诊断/截断, Diagnosis,
  test_dual_claw_wiring_source_guard 校验 chat.py/im_llm.py 接线)
- 新增 docs/dual-claw-event-contract.md (#873 契约文档 7 节)
- 全量 pytest 64 用例全绿 (含 test_dual_claw/test_node_registry 无回归)
- 仅文档/测试,非运行时代码,不 push
2026-08-04 17:28:57 +08:00
QihuAI Design 33d0f9c32e feat(workflow #874): NodeRegistry 统一工作流节点抽象 + 双 Claw 事件对齐
#874 P3 工作流引擎 NodeRegistry 统一(加速带「工具即节点」思想落地,零源码拷贝重写):

- app/core/node_registry.py(新增):把 skill / MCP / Agent / DAG 四套割裂表达收敛为
  单一 Node 抽象。BaseNode(Protocol) 定义 node_type/name/input_schema/output_schema/
  risk_level + async run(ctx);NodeContext 携带 db/tenant_id/claw_type/trace_id/黑板/emit;
  NodeResult.to_blackboard() 与既有 orchestrator 黑板结构无缝互转。内建八型节点
  llm/reduce/local/external/agent/skill/mcp/loop,均继承 NodeBase 公共生命周期
  (发 start 步骤 -> 执行 -> ok/fail 覆盖同 index),异常统一归一为 NodeError(带结构化
  diagnosis)。SkillNode 用 asyncio.to_thread 包裹同步执行器避免阻塞事件循环;
  LoopNode 硬限流 20 次迭代 / 并发上限 5,子节点经 ctx.child() 复用同一 StepCounter 与
  emit,保证步骤序号全图唯一。CapabilitySnapshot 统一承载 skills/mcp_servers/agents/
  function_definitions/mcp_tool_map,供 _build_system_prompt、run_graph、yaml 校验三处
  共用同一份能力真相。normalize_claw() 将 im_wechat/im_platform 归一为 "im",避免
  Grafana 维度碎片化。

- app/core/capability_discovery.py:新增 discover_agents(),与 discover_skills 同构的
  三级降级策略(显式安装 -> published 兜底 -> rank_by_query 裁剪),补齐 Agent 维度的
  统一能力发现,杜绝各处内联第二份发现逻辑(#866 回退事故教训)。

- app/core/orchestrator.py:VALID_NODE_TYPES 与 validate_graph 改为运行期读
  registry.node_types()/requires_agent(),注册表成为节点类型的单一真相源;_run_node 改为
  拼装 NodeContext 后委托 registry.get(ntype).run(ctx),本体只保留调度与拓扑;run_graph
  新增 on_event/claw_type/tenant_id/snapshot 参数,编排全过程以统一 EngineEvent 下发。

- app/core/yaml_workflow.py:valid_node_types() 实时读注册表;validate_yaml 补 skill/mcp/
  loop 必填校验;yaml_to_orchestration / orchestration_to_yaml 双向透传节点扩展字段
  (label/skill_id/func_name/tool/server_id/args/body/items/split/max_iterations/
  concurrency/join),修复配置往返丢字段。

- app/core/engine_event.py:make_step 新增 node 参数,以 step["node"]={id,type,label}
  承载节点身份。设计书原文的 EngineEvent(kind="node") 与前端仅识别 thinking/skill/mcp/
  agent/kb/media 的现状冲突(未知 kind 会被静默丢帧),故映射为已知 kind + 附加字段,
  线格式对旧前端字节兼容。

- app/api/chat_service.py:Web Claw 编排调用点透传 on_event/claw_type/tenant_id,
  租户与通道标签复用 #875 的 ContextVar(get_route_ctx),不再新增一层参数透传。
  IM Claw 经 EngineCore 自动继承同一事件流(单引擎原则,im_llm.py 零改动)。

- tests/test_node_registry.py(新增):R-NODE-1~11 确定性哨兵,无网络无外部依赖。守卫
  内建八型齐全、注册表为单一真相源(orchestrator 与 yaml 校验实时同源)、describe 契约、
  双 Claw 事件对齐(SseAdapter 与 BufferAdapter 逐键相等且均带 node 身份)、claw 归一与
  tenant 标签、新节点必填校验、YAML 往返不吞字段、Loop 限流聚合、失败结构化诊断两端可见、
  禁止第二份能力发现、register 拒绝非法节点。

验证:容器内 py_compile 全通过;pytest tests/ 退出码 0(85 项 = 83 passed + 2 skipped,
0 FAILED/ERROR),含 R-NODE 16 项与 R-DUAL 双 Claw 哨兵。

safe-align: 仅复制 7 个 git-tracked 文件,未触碰 secrets/.venv/node_modules/dist/caches。
本地提交不 push。
2026-08-04 15:16:00 +08:00
QihuAI Design 04a0641202 feat(otel #876): 双 Claw 强制标签 + 入口接线 + Grafana 双 Claw 对比看板
#876 OpenTelemetry 可观测(双 Claw 标签):
- app/core/otel.py: 新增 set_otel_ctx/get_otel_ctx(ContextVar 三元组 tenant_id+claw_type+
  trace_id);current_span_cm 自动注入双 Claw 强制标签,全部 13 个 span 调用点零签名侵入带维度;
  record_span_metrics 指标维度补 tenant_id+claw_type(trace_id 因高基数不计入指标标签)。
- app/core/llm_router.py: set_route_ctx 桥接转调 set_otel_ctx(单次入口注入双端共享:
  路由上下文 + OTel 标签),失败安全。
- app/api/chat.py: send_message 与 send_message_stream 入口注入 set_route_ctx(web),
  stream 经 asyncio.create_task 子协程自动传播 contextvars,使 _send_message_core 内
  所有 span 均带 tenant_id+claw_type。
- app/api/im_llm.py: _call_real_llm 入口最早注入 set_route_ctx(im_wechat),并显式开启
  im.send_message span(此前 IM Claw 完全无 span,Grafana 无 IM 数据点),finally 关闭。
- tests/test_dual_claw.py: R-DUAL-6 由 skip 转为确定性断言(Web/IM 双 Claw span 必带
  tenant_id+claw_type),作为持续哨兵。
- 交付 Grafana 双 Claw 对比看板 JSON(aiflow_span_* / aiflow_llm_route_total 按 claw_type
  分组:P50/P95 延迟、成功率、QPS、租户健康 Top10)。Alloy OTLP 仅桥接 metrics→Prometheus,
  trace 无 pipeline(#800 已压制 UNIMPLEMENTED 噪声),看板基于 metrics 出图。

safe-align: 仅复制 5 个 git-tracked 文件,未触碰 secrets/venv/node_modules/caches。本地提交不 push。
2026-08-04 13:49:34 +08:00
QihuAI Design 180409d317 feat(#875): LLM Router shadow mode + consolidate litellm master key 2026-08-04 13:16:30 +08:00
QihuAI Design 037c965c26 feat(engine): #873 dual-Claw event contract + SseAdapter/BufferAdapter + chat.py SSE delegate + im_llm EngineCore thin-shell (gray-gated)
- app/core/engine_event.py (#880): EngineEvent dataclass + make_* factories, single construction entry, byte-compatible wire with legacy ChatPage.tsx
- app/core/claw_adapters.py (#884): SseAdapter (hot frames zero-metadata, terminal keeps trace_id) + BufferAdapter (assemble() preserves __media__)
- app/api/chat.py (#881): /messages/stream now delegates to SseAdapter; wire bytes unchanged (46B delta / done+message_id)
- app/api/im_llm.py (#883): IM_USE_ENGINE_CORE gray gate; _call_engine_core reuses EngineCore via BufferAdapter (default OFF, preserves media fast-path)
- app/api/chat_service.py: capture 3 container-ahead fixes (stray import asyncio removed, logger.info format, LiteLLM master key)
2026-08-04 12:25:12 +08:00
QihuAI Design 34648e4810 fix(im_bot): segment long WeChat text replies + enhance send diagnostics (#878)\n\niLink returns HTTP 200 but WeChat silently drops long messages (1698-char\nHTML image link, 3011-char skill list). Add WECHAT_TEXT_MAX_LEN=1500 and\nsegment long text into multiple items. Also log payload item lengths and\nmedia URL lengths for future diagnosis. 2026-08-04 11:14:02 +08:00
QihuAI Design f4e18bafe4 test: add R-DUAL dual-Claw regression sentinel (#873) - always-on guards for IM unified discovery / Web-IM parity / naming single-source; opt-in live MCP reachability; R-DUAL-3/6 pending 2026-08-04 10:42:45 +08:00
QihuAI Design 29a1ce2e54 fix: 双Claw能力对齐 + MCP/LLM代理绕过(P0止血)
- 新增 app/core/capability_discovery.py:统一能力发现层,Web/IM 双Claw共用单一实现
  (三级降级:用户安装 → 平台published → 相关性裁剪;MCP 自动挂载已启用服务)
- im_llm.py:IM Bot Claw 改用统一发现层,恢复 skills(12) + MCP(26工具) 能力,
  修复 #866 部署回退导致的 agents=[]/mcp=[] 回归;mcp__ 前缀分流到 call_mcp_tool
- mcp_client.py:注入 httpx_client_factory(trust_env=False) 绕过容器 HTTP_PROXY,
  修复外部 MCP(xiaobenyang.com / anysearch.com) tools/list 全部静默失败(mcp_tools 0→26)
- llm_client.py / im_bot_user.py:2026-07-31 代理劫持内部请求 + 媒体断连修复(随镜像已上线)
2026-08-04 10:21:19 +08:00
QihuAI Design 9a43ee244d fix(im_llm): 代理绕过Docker内部hostname 2026-07-31 08:51:15 +08:00
QihuAI Design 96aabc31f6 feat: mumuainovel app service infrastructure (db+compose+nginx) 2026-07-28 11:41:40 +08:00
QihuAI Design a9d8642db5 phase2-risk-loop-mempalace
CI / gate (push) Has been cancelled
2026-07-28 09:18:16 +08:00
QihuAI Design 88b9a232ce fix-frontend-3-items-complete
CI / gate (push) Has been cancelled
2026-07-28 06:31:48 +08:00
QihuAI Design 1633d5c33e phase1-agent-canvas-done
CI / gate (push) Has been cancelled
2026-07-27 23:20:22 +08:00
QihuAI Design 96be3fdeb3 phase1-final
CI / gate (push) Has been cancelled
2026-07-27 22:27:56 +08:00
QihuAI Design 52f1770515 phase1-complete-billing-skillruntime 2026-07-27 18:16:28 +08:00
QihuAI Design 89ce7d80dc phase1-billing-skillruntime 2026-07-27 18:14:57 +08:00
QihuAI Design 65440d91ee phase1-billing-meilisearch 2026-07-27 17:05:21 +08:00
QihuAI Design 1e0bd6f7a2 phase1-skillmd-v2-schema 2026-07-27 16:55:48 +08:00
QihuAI Design a336ac283d phase0-litellm-deployed-via-hk-proxy 2026-07-27 15:54:28 +08:00
QihuAI Design cf8c955d45 phase0-containers-meilisearch-litellm
CI / gate (push) Has been cancelled
2026-07-27 11:09:49 +08:00
QihuAI Design 245484a0c5 phase0-final-rls-rbac-complete
CI / gate (push) Has been cancelled
2026-07-27 09:57:55 +08:00
QihuAI Design 2068421d41 phase0-fix-auth-order-db-migration 2026-07-27 09:54:03 +08:00
QihuAI Design 7b1941fdaf phase0-multi-tenant-rls-rbac 2026-07-27 09:44:06 +08:00
QihuAI Design f9c8bda6e0 docs-add-iteration-plan
CI / gate (push) Has been cancelled
2026-07-27 09:26:16 +08:00
QihuAI Design ec7de645f4 docs-add-architecture-blueprint
CI / gate (push) Has been cancelled
2026-07-27 09:10:11 +08:00