149 Commits
Author SHA1 Message Date
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
SeniorDev 0820d408eb #938 ChatPage UX 打磨 (移动端响应式 + 暗态增强 + 代码块复制按钮) 2026-08-09 21:40:44 +08:00
SeniorDev 048671870a stage3: 技能/应用市场解耦 - 前端拆分 (/marketplace/products + /admin/market-products) 2026-08-09 06:59:29 +08:00
QihuAI Design 9a43ee244d fix(im_llm): 代理绕过Docker内部hostname 2026-07-31 08:51:15 +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 efa63f9d25 fix-overflow-x-horizontal-scroll
CI / gate (push) Has been cancelled
2026-07-27 08:54:39 +08:00
QihuAI Design bb32884ecb p2-mcp-schema-error-step-enhancements
CI / gate (push) Has been cancelled
2026-07-26 20:59:52 +08:00
QihuAI Design 640edc4970 chore: normalize tsconfig.json line endings (file missed by prior commit)
CI / gate (push) Has been cancelled
The earlier renormalize commit (771c845) missed frontend/tsconfig.json; this
completes the LF normalization so all tracked text files are LF. .gitattributes
(* text=auto eol=lf) prevents future CRLF.
2026-07-25 12:33:53 +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 256d9f33e6 chore(align): sync Git with running container as authoritative source
Phase 0 SSE 流式聊天 landed in the running container and captured in Git so
the three sources (container := image := Git) agree.

Phase 0 — SSE 流式聊天(Web 端,IM bot 路径保持不变、共用引擎):
- app/api/chat.py: 新增独立 SSE 端点
  POST /app/api/chat/conversations/{conv_id}/messages/stream
  基于 asyncio.Queue + create_task 将 _send_message_core 桥接为
  text/event-stream 生成器,吐出 delta / reasoning / done / error 事件
- app/api/chat_service.py: _send_message_core 增加 stream + on_event 参数;
  普通(无工具)聊天 round-0 主调用走 achat_complete(stream=True) 流式;
  done 事件携带 message_id / content / process_steps / used_skills /
  used_mcp / generating
- app/core/llm_client.py: 修复 _create_kwargs 硬编码 stream=False 的根因 bug
  (流式调用传 stream=True 导致 TypeError: multiple values for keyword),
  现 _create_kwargs(request_body, stream=True) 字段随参数变化
- frontend/src/pages/front/ChatPage.tsx + ChatPage.css + types/index.ts:
  发消息改为 fetch SSE 消费,实时增量渲染 AI 回复文本与思考链(reasoning),
  done 事件用 message_id 定稿并渲染过程步骤;网络/流式失败自动回退非流式

Alignment performed 2026-07-24 18:25:11. No deletions; secrets/venv/node_modules/
caches were not touched (tracked-source-only copy).
2026-07-24 18:25:15 +08:00
QihuAI Design 3788a93425 chore(align): sync Git with running container as authoritative source
Phase 0 SSE 流式聊天 landed in the running container and captured in Git so
the three sources (container := image := Git) agree.

Phase 0 — SSE 流式聊天(Web 端,IM bot 路径保持不变、共用引擎):
- app/api/chat.py: 新增独立 SSE 端点
  POST /app/api/chat/conversations/{conv_id}/messages/stream
  基于 asyncio.Queue + create_task 将 _send_message_core 桥接为
  text/event-stream 生成器,吐出 delta / reasoning / done / error 事件
- app/api/chat_service.py: _send_message_core 增加 stream + on_event 参数;
  普通(无工具)聊天 round-0 主调用走 achat_complete(stream=True) 流式;
  done 事件携带 message_id / content / process_steps / used_skills /
  used_mcp / generating
- app/core/llm_client.py: 修复 _create_kwargs 硬编码 stream=False 的根因 bug
  (流式调用传 stream=True 导致 TypeError: multiple values for keyword),
  现 _create_kwargs(request_body, stream=True) 字段随参数变化
- frontend/src/pages/front/ChatPage.tsx + ChatPage.css + types/index.ts:
  发消息改为 fetch SSE 消费,实时增量渲染 AI 回复文本与思考链(reasoning),
  done 事件用 message_id 定稿并渲染过程步骤;网络/流式失败自动回退非流式

Alignment performed 2026-07-24 16:28:19. No deletions; secrets/venv/node_modules/
caches were not touched (tracked-source-only copy).
2026-07-24 16:28:19 +08:00
QihuAI Design 2721da5d4c feat: 思考过程展示优化 — 先展开再自动收拢
AiProcessBlock 改进:
- 超时从 2.6s 延至 6s,用户有充足时间阅读思考链路
- 新增 aiProcessPulse 脉冲高亮动画,强调'思考过程刚出炉'
- 展开时自动 scrollIntoView,确保不被正文遮挡
- 摘要文案改为'AI 思考 / 执行过程(N步 — 自动收拢中...)'

CSS 新增:
- .ai-process-fresh 脉冲动画 + summary 文字高亮
- @keyframes aiProcessPulse: 0→50%→100% 边框扩散+收拢
2026-07-23 22:00:49 +08:00
QihuAI Design 4a95657030 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 16:04:25. No deletions; secrets/venv/node_modules/
caches were not touched (tracked-source-only copy).
2026-07-23 16:04:26 +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 6da8c3938e fix(admin/mcp): prevent unnecessary wrapping in table headers and badges 2026-07-22 08:54:03 +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
qihu-dev c32eed39bd feat(chat): 收拢式AI思考/执行过程可视化 + 修复span(name)重复传参导致技能/MCP执行崩溃 2026-07-22 00:17:54 +08:00
QihuAI Design 97125d7b65 T4: AnySearch 改为全局固定配置 + 修复外部服务弹窗 UI 2026-07-21 19:27:27 +08:00
QihuAI Design 7674729804 test(frontend): extract Markdown renderer to utils/markdown.ts + add vitest regression tests
CI / gate (push) Has been cancelled
2026-07-20 20:32:36 +08:00
QihuAI Design 5def2697de fix(chat): image send 500 + table/newline formatting (v2026.07.20.1708)
CI / gate (push) Has been cancelled
2026-07-20 17:08:20 +08:00
QihuAI Design 612ce37518 audit fixes: align all frontend timestamps to Beijing time + debounce MarketPage search (vv2026.07.20.1)
CI / gate (push) Has been cancelled
2026-07-20 15:38:55 +08:00
QihuAI Design d55a496ff4 Phase 4.3 ACA: MCP.tsx protocol selector panel + api ACA methods (v2026.07.19.12)
CI / gate (push) Has been cancelled
2026-07-20 14:45:21 +08:00
QihuAI Design 72d6f9ab66 Phase 4.1+: mermaid diagrams + YAML workflow buttons + agents API (v2026.07.19.11)
CI / gate (push) Has been cancelled
2026-07-20 09:24:40 +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 71fc502a92 Phase 3.3 前端: 后台 Agent 编排图 JSON 编辑器(载入/校验/保存/清除/示例)
CI / gate (push) Has been cancelled
2026-07-19 16:55:20 +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 dd10245ad5 test: 前端 vitest 测试基建 (Phase0) — 北京时间渲染回归 4 用例全绿 2026-07-18 23:47:21 +08:00
QihuAI Design 1578d68f95 fix: 修复前台4项问题(MCP列举/微信技能上限/Word资产栏/技能MCP反馈) + 同步容器live状态
- #549 平台MCP列举: 注入全量已启用MCP清单, AI不再凭空编造
- #550 微信Bot技能自动发现上限 15->300
- #551 知识库Word文档同步资产后Word栏可见 + 双向删除同步(assets/knowledge级联软删)
- #552 对话反馈实际使用的技能/MCP(used_mcp字段), 含历史消息序列化
- 同步容器内其他未提交live改动(im_bot_platform/TokenDashboard/WechatBot/ChatPage)
2026-07-18 08:06:37 +08:00
QihuAI Design cc35c61fbd fix: 技能市场分类映射缺失+筛选chip激活态配色;聊天显式选中技能时正确介绍技能并精简回复排版 2026-07-17 21:45:30 +08:00
QihuAI Design f8d1c18927 fix(admin): 后台未登录访问 Skills/MCP/Agent 报 Not authenticated\n\n- AdminLayout 增加登录+管理员守卫,无 token 或非 admin 跳 /login\n- api request() 处理 403 Not authenticated/需要管理员权限,清 token 跳登录\n- 根因:FastAPI HTTPBearer 无 token 返回 403 而非 401,前端未处理 403 跳转 2026-07-17 20:46:05 +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
QihuAI Design c9b5f964be feat(frontend): per-platform Streamable HTTP input for MCP Hub import 2026-07-16 17:36:58 +08:00
QihuAI Design e856f186be ui(mcp-hub): MCP导入弹窗复用 skills 优化方案
两个问题:
1. 标题"导入Hub - MCP"偏左未居中 — .market-modal-header h2
   加 flex:1 + text-align:center
2. 说明textarea 与 MCP传输代码 框紧挨着无分隔 —
   .hub-code-section 加 margin-top: var(--space-xl)
2026-07-16 16:39:12 +08:00
QihuAI Design e95fec0c1b ui(admin): 修复后台侧边栏 logo 区域未垂直居中
.admin-sidebar-header 原 align-items: baseline + height: var(--header-height) + padding: 0
导致 logo 紧贴顶部边线。

修复:
- align-items: baseline → center
- padding: 0 var(--space-lg) → var(--space-md) var(--space-lg)
- height → min-height
- justify-content: center (水平居中)
- logo/subtitle 加 line-height: 1 + display: flex align-items: center
2026-07-16 16:30:57 +08:00
QihuAI Design dc577eb0f0 feat(chat): 增强AI回复渲染 — 代码高亮/KaTeX数学/删除线/URL自动链接
新增渲染能力:
1. highlight.js 代码语法高亮 + 复制按钮 (hover显示)
2. KaTeX 数学公式渲染 ($$...$$块级 + $...$行内)
3. 删除线 ~~text~~ → <del>
4. 裸URL自动转可点击链接

依赖: npm install highlight.js katex mermaid
2026-07-16 16:25:41 +08:00
QihuAI Design 8486a2a0e5 ui(chat): MarkdownContent 支持表格渲染
AI 聊天回复中常出现 Markdown 表格语法 (| h1 | h2 | + |---|---| ),
但 MarkdownContent 仅支持 headers/lists/code,未渲染表格,
显示为原始 | 分隔文本。

修复:
1. ChatPage.tsx MarkdownContent 新增表格解析步骤(步骤 2.7)
   - 匹配 | header |
|---|---| 的多行表格块
   - 解析对齐方式 (:---, :---:, ---:)
   - 生成 <table><thead><tbody> HTML
2. 步骤 10 恢复占位符,步骤 11 解包 <table> 不被 <p> 包裹
3. ChatPage.css 新增 .md-table 样式
   - 蓝色渐变表头 + 斑马纹 + hover 高亮
   - 用户消息气泡内深色适配
2026-07-16 16:15:29 +08:00
QihuAI Design 4d27dd3429 ui(import-hub): 优化 skills.sh 卡片布局
- skills.sh 卡片改为列布局:
  顶部:图标+名称+URL(左侧)+ 访问按钮(右上)
  中部:URL 输入框(全宽)
  底部:检测名称预览 + 导入按钮(右下)
- 加大"说明"与平台卡片的间距(margin-top: space-xl)
- 导入按钮与名称预览在右侧同一行,间距更协调
2026-07-16 16:00:35 +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