70 Commits
Author SHA1 Message Date
qihu-bot 552a962123 #977 时间错位8小时彻底修复 - _beijing_now返回aware
CI / gate (push) Has been cancelled
根因: _beijing_now返回naive datetime(无时区), PG timestamptz列按UTC误解, 存13:53UTC前端按Asia/Shanghai显示21:53错位8小时。修复: 去掉replace(tzinfo=None)返回aware datetime(带+08:00), PG正确转UTC存储, 前端正确显示。
2026-08-18 14:01:57 +08:00
qihu-bot ab11283d92 #976 微信对话同步WebClaw修复 + admin连接时间统一北京时间
CI / gate (push) Has been cancelled
1.mirror_to_ai_chat: _uuid→uuid(NameError被except吞了, 对话从未同步到webclaw) 2.im_bot_admin加_beijing_now并替换5处datetime.now()(容器UTC存naive时间前端按+08:00展示错位8小时)
2026-08-18 13:47:07 +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
QihuAI Design 9a43ee244d fix(im_llm): 代理绕过Docker内部hostname 2026-07-31 08:51:15 +08:00
QihuAI Design a2504bce34 fix(chat): resolve Auto-route failover event-loop freeze (#812)
Root cause: ensure_structured_column() executed a synchronous blocking
engine.connect().execute(SELECT information_schema.columns ...) inside the
async request path (_build_chat_history / _maybe_compress_history), freezing
the uvicorn event loop and hanging all endpoints (~200s, recovered only by
docker restart).

Fix:
- chat_context.py: remove per-request ensure_structured_column() calls; run
  once idempotently at app startup (main.py lifespan). Use CURRENT_DATABASE()
  for PostgreSQL compatibility.
- main.py: add startup-only ensure_structured_column() hook (try/except).
- llm_client.py: trust_env=False + bounded httpx.Timeout/wait_for so broken
  endpoints fail fast instead of hanging the event loop.
- chat_service.py: run media generation in a background daemon thread with its
  own event loop (_launch_media_task_bg) so SSE end does not cancel image/video
  tasks (#811); remove TEMP faulthandler diagnostic.

Safe-align: persist accumulated live container changes (admin/*, knowledge,
market, models, config, observability, mcp_client, platform_knowledge,
im_bot_platform, chat_media, capability_registry, requirements) and add
workflow_templates.

Verified: live failover test (model-006 -> conn-refused) returns in ~1.9s with
concurrent login 0.83s/200; event-loop responsiveness restored (sub-second).
2026-07-26 00:35:35 +08:00
dev 019e1151d0 fix(mcp_admin): add module-level import asyncio to fix 500 in test_mcp_connection (#766 root cause)
CI / gate (push) Has been cancelled
2026-07-25 14:03:36 +08:00
QihuAI Design 771c8456b8 chore: normalize line endings to LF via .gitattributes
Root-cause fix for mixed CRLF/LF in the repo (no .gitattributes previously).
Adds '* text=auto eol=lf' and explicit binary rules so all future checkouts
are LF. Renormalizes all tracked text files (no logical content change).
Backup tags: image qihuaiflow:backup-lineend-20260725-121632, git backup-lineend-pre-20260725-121632.
2026-07-25 12:16:39 +08:00
QihuAI Design 2a7bb875f9 fix(mcp/chat): root-cause fixes for AnySearch MCP test + URL app install
- mcp_admin.py: replace get_event_loop().run_until_complete() with asyncio.run() in _test_mcp_server worker-thread path (RuntimeError: no current event loop in thread). Fixes backend AnySearch 'test failed'.
- chat_skill.py: add synchronous _execute_install_app() that auto-detects skill/mcp/agent from a URL and creates MarketApp(+MCPServer is_enabled=True for mcp) + AppInstallation. No running-loop asyncio call (called sync from chat dispatch).
- chat_service.py: register 'install_app' function_definition and dispatch branch so the AI chat can install skills/mcp/agent by URL.
Image already persisted via docker export/import (qihuaiflow:with-deps=aaf6fe67cde8) because base image was pruned and docker commit failed.
2026-07-25 11:51:19 +08:00
QihuAI Design a08ec87b22 chore(align): sync Git with running container as authoritative source
One-time alignment to close drift between the running container
(qihu-aiflow / image qihuaiflow:with-deps) and this Git repository.
Container hotfixes previously persisted only via `docker commit` are now
captured in Git so Git becomes the single source of truth.

Backend:
- chat_service.py: accumulated fixes incl. EigenFlux README guidance
- chat_context.py / chat_media.py: URL/web-repo context injection
- api/url_reader.py: NEW SSRF-safe web/README reader (Issue #725)
- skills_admin.py & Skills.tsx: 14-scene capability unification
- pgvector_search.py, orchestrator.py, platform_knowledge.py,
  market.py, admin/models.py: drift sync

Frontend:
- ChatPage.tsx: collapsible AI think/act block (Issue #724)
- MarketPage / EvolutionDashboard / TokenDashboard styling sync

Migrations:
- 018_normalize_marketapp_scene.sql: fixed capability allowlist
  (prevents capability wipe on restart)

Alignment performed 2026-07-23 05:42:47. No deletions; secrets/venv/node_modules/
caches were not touched (tracked-source-only copy).
2026-07-23 05:42:48 +08:00
QihuAI Design 97125d7b65 T4: AnySearch 改为全局固定配置 + 修复外部服务弹窗 UI 2026-07-21 19:27:27 +08:00
QihuAI Design 3c9d9518b1 T4: AnySearch 联网检索接入 (anysearch_client trust_env直连 NO_PROXY, kb_router use_web RRF融合, chat_context 自动注入联网上下文, admin 支持 anysearch 服务类型, 新增 POST /api/knowledge/web-search 端点) 2026-07-21 18:29:51 +08:00
QihuAI Design 0b00d6da45 fix: 文生图连接测试 size 1024x1024 + 媒体端点智能推导 + 图像/视频模型 failover 路由(默认模型第一顺位) 2026-07-20 22:11:53 +08:00
QihuAI Design 79c27795a8 Phase 4.2+4.3: YAML workflow spec + ACA protocol abstraction (v2026.07.19.10)
CI / gate (push) Has been cancelled
2026-07-19 20:17:49 +08:00
QihuAI Design c716dab851 Phase 4.1+: expose version/verified/security_scan/dependencies in admin get_all_apps
CI / gate (push) Has been cancelled
2026-07-19 19:29:48 +08:00
QihuAI Design 669c16b0a0 Phase 4.1: 技能市场安检引擎 + 版本化 + 绿标 (v2026.07.19.9)
CI / gate (push) Has been cancelled
2026-07-19 19:15:35 +08:00
QihuAI Design 96b3f0af37 Phase 3.3 多 Agent 编排图引擎: orchestration JSON 列 + 拓扑并行引擎 + local/external/reduce 节点 + 工具沙箱继承 + 后台编排 API
CI / gate (push) Has been cancelled
2026-07-19 16:41:27 +08:00
QihuAI Design 0600c37b9e feat(agents): Phase3.1 工具/MCP权限沙箱(tool_policy) 白名单+预算熔断+每轮上限+后台管理UI [v2026.07.19.6]
CI / gate (push) Has been cancelled
2026-07-19 12:34:40 +08:00
QihuAI Design 2969544d54 feat(observability): Phase2.3 媒体/LLM 可观测面板(后端归因聚合+前端页) 并修复 token_usage_logs trace_id 写入(chat_service/im_llm) [v2026.07.19.5]
CI / gate (push) Has been cancelled
2026-07-19 10:18:14 +08:00
QihuAI Design 1ea7ea352f chore: remove accidental .bak file 2026-07-18 13:54:19 +08:00
QihuAI Design d593d8dc42 fix: 显式选中技能/MCP 时优先按工具资料回答 + 媒体任务超时/日志
- _build_system_prompt 末尾增加【最高优先级覆盖规则】:用户明确选择技能/MCP 并询问其介绍/功能/用法时,
  必须只基于该工具资料作答,禁止引用平台知识库中技能市场/MCP/平台能力的通用描述。
- _generate_media_task 增加启动/结束日志,对图像生成加 90s 超时、视频 300s 超时,避免异步任务挂死导致前端一直显示“生成中”。
2026-07-18 13:52:26 +08:00
QihuAI Design 7fb7c07f57 fix(admin/skills): 支持删除从市场导入的 MarketApp 技能 2026-07-17 22:25:47 +08:00
QihuAI Design 47d38ca173 fix(MCP): 修复导入MCP时传输代码丢失导致无法连接的问题
- 前端 MarketPage 提交时随 download_url 发送粘贴的 MCP 代码(handleSubmit+handleCreateApp)
- 后端新增 parse_mcp_config 解析标准 JSON 配置, 提取 url/headers/transport
- upload_app 与 _sync 使用解析器落库 mcp_servers 并自动连通性测试
- _test_mcp_server 连接测试携带 headers 鉴权头
- 优化 MCP 代码输入框占位符为真实配置格式
2026-07-17 09:43:43 +08:00
QihuAI Design ab90ac9473 fix: MCP后台删除/禁用同步清理market_apps源头,避免被_sync复活 2026-07-16 20:09:16 +08:00
QihuAI Design 6331e84185 feat: MCP streamable_http connection test + auto-test on import 2026-07-16 18:38:10 +08:00
QihuAI Design feb9865b00 fix: sync MarketApp MCP records to admin MCP Client management 2026-07-16 18:12:07 +08:00
QihuAI Design 0e6f1931e1 fix(skills-admin): market 项加 publish_records 字段,列表"已发布"标识正确显示
修复顶部卡片(已发布=50)与列表行(市场=未发布)不一致问题:
列表行 isPublished 仅看 skill.publish_records[],
market_apps 项无该字段故一直显示"未发布"。
改为 market_app_to_skill_dict 中按 status 注入 publish_records。
2026-07-16 15:46:43 +08:00
QihuAI Design 8942339744 fix(skills-admin): get_skills_stats 合并 market_apps(type=skill) 统计
修复顶部卡片仍显示 0 的问题:list_skills 已支持合并查询,
但 stats/overview 端点仍只读 evolution_skills。
新增对 market_apps 的统计: published→main, 其它→baby。
验证: total_skills=50, by_state.main=50, total_published=50
2026-07-16 15:39:21 +08:00
QihuAI Design ce81297159 fix: 修复技能市场分页、后台Skills管理、微信Bot图片生成超时
1. MarketPage.tsx: getApps 加 page_size=100,修复只显示20条
2. skills_admin.py: list_skills 同时查询 market_apps(type=skill)
   解决前台导入50个技能后台看不到(前后台用不同表)
3. im_llm.py: _run_async 加 timeout 参数,_call_real_llm 媒体生成
   5分钟超时保护,解决微信Bot图片生成无限期挂住的问题
2026-07-16 15:10:50 +08:00
deploy 6416fb4651 fix(admin): 修复注册设置PUT接口——由独立query参数改为接收JSON body
根因:PUT /admin/users/register-settings 参数定义为 phone_required: bool = None 等独立query参数,
但前端发送的是 JSON body {"phone_required":true,"email_required":true}。
FastAPI无法把JSON body映射到独立参数 → 全部收到None → 循环跳过 → DB无更新(提示成功但无效)。
修复:参数改为 body: dict 统一接收JSON,用 body.get() 取值更新 RegisterSetting 表。
2026-07-15 18:50:36 +08:00
deploy 148e4a21c2 fix: 全面修复6项问题——Auto模型路由/媒体提示词优化/微信Bot/Token驾驶舱/技能市场清空
1. resolve_auto_model: image/video/audio无显式默认时自动发现启用模型(原返回None→文本模型回退→AI说无法生成)
2. 新增_optimize_media_prompt: 调用文本LLM精炼用户原始输入为AGNES高质量提示词(去除对话噪音+英文优化)
3. detect_media_intent: 扩展关键词覆盖多轮对话模式(做图片/生成个图/画一下/制作视频等)
4. chat.py+im_llm.py: 所有httpx调用补trust_env=False+_proxy_for_url, 规避容器坏代理
5. token_usage.py: 模型名回退链(model表→日志自带的model_name→auto标签), 不再显示unknown
6. skills_admin.py: 新增POST /batch-delete批量删除API(ids空则删全部)
7. 技能市场数据已清空, 用户可重新导入技能
2026-07-15 17:05:00 +08:00
QihuAI Design a1669374e6 feat(kb): 接入 Dify 知识库,移除 FastGPT;AI 聊天产出+用户文档自动入库量化
- 新增 app/dify_kb.py Dify v1 客户端(连通测试/检索/文本入库)
- kb_router 仅保留 Dify 外部检索分支
- knowledge_admin 去掉 FastGPT/RAGFlow,新增 dify 批量入库端点
- chat.py 注入 Dify RAG 上下文 + 助手回答 fire-and-forget 入库
- 前端 Knowledge.tsx 改为 Dify 单服务 UI(可通讯/可用验证+入库按钮)
- DB: external_kb_services 删除 fastgpt,qihuai 设为 https+connected
2026-07-14 20:56:53 +08:00
QihuAI Design fcc84d98df 增强后台数据驾驶舱:6张指标卡(近7天活跃/订阅成功/文档数等)+30天Token趋势+操作/审计日志分页与CSV下载 2026-07-14 12:00:19 +08:00
QihuAI Design ab54d7344c refactor: 移除通用频道管理(LangBot)模块,IM Bot 改为直接对接;迁移 _call_real_llm 至 im_llm 2026-07-14 08:21:56 +08:00
QihuAI Design e38e18fbe7 feat(admin): 短信配置独立页+短信宝支持;后台顶部面包屑导航优化 2026-07-13 19:24:13 +08:00
qyyfw ab9cf55321 recover: chat.py Auto routing + models.py capability-defaults route (lost in 5d7f32d) 2026-07-12 07:12:59 +08:00
qyyfw e8e5ffa1a9 fix: 恢复 rsync 误删的近期开发(agents/skills/mcp/knowledge/workflow/tenant/billing/storage/privacy/promotion/achievement/automation/code-exec/developer/distribution/im-bot/portal/casdoor 等后端模块 + 对应前端页面路由, 补回 main.py 挂载与 App.tsx 路由 2026-07-11 11:40:39 +08:00
qyyfw 5d7f32db0a refactor: sync running-container source back to repo for reproducible docker compose build; remove dead code (orphan pipeline.py + 104 stale files from iterative dev) and drop unused app/ mirror dir 2026-07-11 06:29:32 +08:00
qihu 1346fbbd4b perf: 前端路由级代码分割+资源长期缓存;后端列表查询封顶与N+1修复;Dockerfile将依赖烤入.venv根治升级崩溃 2026-07-11 05:02:14 +08:00
qyyfw 363ef7d7b6 fix: 修复按能力默认模型/批量测试的路由被 /{id}/test-connection 路径参数拦截导致 404 模型不存在 2026-07-10 20:48:38 +08:00
qyyfw 4c372746d5 feat: 补全模型能力选项(11种) + 按能力指定默认模型 + Auto自动模式 2026-07-10 20:04:38 +08:00
qyyfw 27ba91ae5e feat(admin): 移除后台 Agent/技能/MCP 手动创建按钮,改为仅支持 URL 导入/AI 开发/AI 安装 - 后台 Agent管理/技能管理/MCP服务 移除 创建/添加 按钮 - 后端上传/创建按操作者角色设定默认值:管理员=官方+已发布+免费;用户=用户+待审核+定价自选 - 应用市场 Hub 导入新增 mcp.so / MCPMarket 平台,导入表单增加定价输入(用户可选收费) - 清理全部演示数据(market_apps/mcp_servers/mcp_tool_configs/evolution_skills) 2026-07-10 16:21:07 +08:00
qyyfw 7c71d193fc fix(email): support implicit SSL (port 465) for SMTP test; add use_ssl field + encryption selector 2026-07-10 09:54:49 +08:00
WorkBuddy 75a708a14d feat: 个人微信改为前台每用户独立绑定(按 user_id 隔离),后台仅保留全局 Bot 2026-07-09 20:53:25 +08:00
qyyfw aec63eaf56 Feature: Multi-tenant + Billing + Analytics - 3 new modules with 40+ API endpoints 2026-07-07 18:53:40 +08:00
qyyfw 839be8f97f feat: membership benefits refinement - permissions and quotas linked to plans 2026-07-07 15:39:01 +08:00
qyyfw 0886c26157 Phase4剩余: 推广+成就系统前后端完成 (promotion + achievement)
- 新增: Achievement.tsx 成就系统前端页面 (644行)
- 新增: achievement_admin.py 成就系统后端API (9个端点)
- 新增: migration SQL (achievements, user_achievements, achievement_progress_log)
- 更新: api/index.ts 添加推广+成就API方法 (23个方法)
- 更新: App.tsx 添加 /admin/promotion 和 /admin/achievement 路由
- 更新: AdminLayout.tsx 添加成就系统导航项和图标
- 修复: Promotion.tsx 导入路径 (@/utils/api → @/api)
- 前端构建: 472 modules, 11.23s, 成功
- API测试: 全部6个端点返回 code=0
2026-07-07 14:51:42 +08:00
qyyfw 7daeae6fc7 Phase 4: IM Bot Integration - admin module, frontend, LangBot gateway, routing rules, quick setup wizard 2026-07-06 19:59:05 +08:00
qyyfw 891d1ce527 Phase G5: Local Agent / Privacy Mode — 4 tables, 19 API endpoints, platform_bridge MCP, PrivacySettings.tsx (740 lines). 25/25 tests pass. 2026-07-06 17:18:05 +08:00
qyyfw 0486210133 Phase G4: Distribution Builder - SaaS product line mgmt, license keys, config export, frontend UI 2026-07-06 16:36:26 +08:00
qyyfw d2e3147fb8 Phase G3: ACP Gateway + DAG Multi-Agent - acp_gateway.py (Agent communication layer, 350L), workflow_admin.py upgraded (async parallel execution + agent_node), Workflow.tsx updated (agent node + real-time streaming + WebSocket) 2026-07-06 15:48:37 +08:00