Commit Graph
26 Commits
Author SHA1 Message Date
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
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 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 6d06f9165c feat(skills): auto-tag+classify existing 60 skills, auto-tag on import, 409 uniqueness check, add tags column to admin 2026-07-22 07:58:40 +08:00
QihuAI Design 46528eddbb fix(market): 补齐MarketApp ORM category/tags字段 + 硬化导入管道(空内容兜底生成SKILL.md + GitHub直链归一) 2026-07-21 20:25:55 +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 3b34ba78b8 feat(agents): Phase3.2 Agent凭据Fernet加密存储 写入加密+调用点解密+返回脱敏+主密钥持久化防竞态 [v2026.07.19.7]
CI / gate (push) Has been cancelled
2026-07-19 15:27:15 +08:00
QihuAI Design e2369b4915 fix(market): 强化场景分类器解析兜底,避免合法 id 误判为 None 2026-07-17 15:44:58 +08:00
QihuAI Design dc3077b5ae fix(market): 强化场景分类器解析兜底,避免合法 id 误判为 None 2026-07-17 15:37:35 +08:00
QihuAI Design fe051bd9f3 feat(market): 采用元宝岗位/职能分类(14类)替代人群场景 + AI验证期自动归类 2026-07-17 15:22:57 +08:00
QihuAI Design 9bcf15099f feat(market): 技能/MCP 分类改为面向用户的业务场景(人群->场景),AI验证期按场景归类 2026-07-17 14:55:21 +08:00
QihuAI Design 6f3fb400a4 feat(market): skills/mcp 能力分类 + AI验证期自动识别 + 导入自动入座 2026-07-17 12:09:42 +08:00
QihuAI Design 2ae5d9f9b5 fix(skills): 修复导入技能时 SKILL 内容丢失导致无法正常工作
- 前端 handleSubmit/handleCreateApp 发送 skillsContent;handleHubImport 对 skill 把目录 URL 作为 download_url
- 后端 upload_app 对 skill 类型写入 skill_content(手动粘贴或 Hub 抓取)
- 新增 _fetch_skill_content 按目录 URL 抓取真实 SKILL.md 回填(best-effort,仅接受有效 markdown)
- 清理 50 条空壳 skill 记录(skill_content 为空,不可恢复)
- 经 E2E 验证:手动粘贴/Hub 抓取/MCP 重导三条路径均能正确落库
2026-07-17 10:46: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 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
deploy b88f883d44 feat(market): admin用户前台导入的Agent/Skill/MCP自动标记为官方(official)
- POST /market/apps: 当 current_user.role == "admin" 时,source 强制设为 official
- 前端发送 source:/user/ 也会被后端覆盖为 official
- 前台卡片已有 official-badge 徽章展示,无需额外前端改动
2026-07-15 18:58:15 +08:00
deploy 4d57987aa5 fix(agent): 外部Dify Agent 手动跟随http->https 301重定向并保持POST(测试连接+运行期);qihuyun.com直连 2026-07-15 14:30:24 +08:00
QihuAI Design d374d464e8 feat: 智能Agent接入前连通性/鉴权校验
- 前端技能市场「接入单个Agent」新增「测试连接」按钮,接入前必须校验通过

- 后端 POST /market/apps/verify-agent:dify 走 chat-messages 鉴权探测(trust_env=False 直连),n8n/coze 走 HEAD 可达性探测

- upload_app 对 agent 类型做服务端守卫,密钥无效/不可达直接 400 拒绝

- MarketApp 新增 platform 列(dify/n8n/coze),009 迁移幂等加列
2026-07-15 13:01:19 +08:00
QihuAI Design bc2899ed09 前台8项体验修复: 知识库上传自动刷新; 资产PDF归类; Token驾驶舱媒体统计; AI模糊意图澄清选择; ChatPage增加MCP/附件上传/语音; 技能市场安装态修复+清理演示数据; MCP协议应用改名MCP应用; Agent单应用接入(名称/介绍/API Key) 2026-07-15 10:33:43 +08:00
QihuAI Design 9b87012248 feat(frontend): 首页广告位网格溢出根治(minmax(0,1fr) minmax(0,1.2fr)+min-width:0) + 精选推荐对接平台广告接口 GET /app/api/market/ads 2026-07-13 20:01:13 +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
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 251bbc4123 fix: Token timezone display + Skill install/uninstall bugs 2026-07-03 16:13:14 +08:00
qyyfw 8ec808b515 fix: 6 bug fixes - timezone CST, knowledge_ids mismatch, skill uninstall, dashboard stats, chat knowledge retrieval, skill selection 2026-07-03 09:18:04 +08:00
qyyfw 78ff261b5a 初始提交: Qihu-AIFlow v2.0.1 完整项目
- 前端 React+TypeScript (源码+构建产物)
- 后端 Python FastAPI
- 数据库迁移 001-015
- Docker部署配置
- 微信ClawBot API频道绑定
- 项目文档 README.md
2026-07-02 14:40:46 +08:00